gitattributes

How do I set all files in a subdirectory to use a specific eol using gitattributes?

邮差的信 提交于 2019-12-06 18:16:30
问题 I've been trying to set specific files to always use lf and not crlf regardless of autocrlf on the local system. I tried creating a .gitattributes at the root of the project that only contained SquishIt.Tests/js/*.js eol=lf and I also tried SquishIt.Tests/js/ eol=lf . I pushed both of these attempts to my remote and then tried cloning it locally twice. The files under /js/ always showed up with CR+LF in both cases as autocrlf is on globally for me. I'm on a Windows machine, just in case it

How to ignore files/directories in “git archive” and only create an archive of a subdirectory?

…衆ロ難τιáo~ 提交于 2019-12-06 08:05:59
TL;DR: The git archive command seems to only either archive a single subdirectory or adhere to .gitattributes and exclude files/directories from the resulting ZIP, but cannot do both. Say I have this directory structure in my git archive (simplified for reasability): . ├── assets ├── build ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE.md ├── README.md ├── scripts ├── src │ ├── background │ ├── common │ ├── icons │ ├── _locales │ ├── manifest.json │ ├── options │ ├── popup │ └── tests └── tests -> src/tests Now I want to get an ZIP (or tar) archive with the following content: content of src

What does “check out code” mean in git documentation for line endings?

谁都会走 提交于 2019-12-06 07:27:03
I'm really confused what "check out code" means in the following page: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#__code_core_autocrlf_code If you’re on a Windows machine, set it to true – this converts LF endings into CRLF when you check out code: Does it mean when you add files? Because whenever I change core.autocrlf from input to true and vice-versa, the differrence I see in when I add the files (does "check out" mean "add"?): > git config --global core.autocrlf true > git add crlf-file.md > git add lf-file.md warning: LF will be replaced by CRLF in lf-file.md. The

`git` shows changed files after cloning, without any other actions

对着背影说爱祢 提交于 2019-12-06 04:19:16
git clone git@github.com:erocarrera/pydot ( 35a8d858b ) in a Debian with git config core.autocrlf input shows: modified: test/graphs/b545.dot modified: test/graphs/b993.dot modified: test/graphs/cairo.dot These files have CRLF line endings, for example: $ file test/graphs/cairo.dot test/graphs/cairo.dot: UTF-8 Unicode text, with CRLF line terminators The .gitattributes file contains : *.py eol=lf *.dot eol=lf *.txt eol=lf *.md eol=lf *.yml eol=lf *.png binary *.ps binary Changing core.autocrlf has no effect on the status of these files. Deleting the .gitattributes has no effect either.

Override .gitattributes text=auto in Windows

試著忘記壹切 提交于 2019-12-05 16:28:04
This is pretty unintuitive: C:\python-tdl\examples\termbox>git config core.autocrlf false C:\python-tdl\examples\termbox>git commit termbox.py warning: LF will be replaced by CRLF in examples/termbox/termbox.py. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in examples/termbox/termbox.py. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in examples/termbox/termbox.py. The file will have its original line endings in your working directory. Aborting commit due to empty

What does “*.jpg binary -delta” do in the .gitattributes file?

自闭症网瘾萝莉.ら 提交于 2019-12-05 05:28:45
问题 This thread is suggesting placing *.jpg binary -delta in the .gitattribute file for repos in git but I am not sure what it does. I cannot find any examples of the '-delta' flag for git. The purpose is to apparently speed up commit or push times for larger files. 回答1: That could be related to: Packing objects delta Delta compression will not be attempted for blobs for paths with the attribute delta set to false. I detail delta storage in "Is the git binary diff algorithm (delta storage)

git line endings : renormalize does not seem to checkout the right line endings

允我心安 提交于 2019-12-04 22:58:30
问题 I decided to set my line endings the Right Way via a .gitattributes file as detailed for instance here - so I set the core.autocrlf to false and created and committed a .gitattributes file : *.java text eol=native *.jsp text eol=native *.css text eol=native *.html text eol=native *.js text eol=native *.xml text eol=native *.sql text eol=native *.MF text eol=native # git files *.gitignore text eol=native *.gitattributes text eol=native #eclipse files *.classpath text eol=native *.project text

.gitattributes smudge and clean filters as a part of the repository

最后都变了- 提交于 2019-12-04 17:30:20
问题 I have a number of template files in my git repository which change at different rates. These are then used to generate HTML pages. If someone reports a problem, I want them to be able to tell me which version of the template file has the problem. Currently, I manually enter the date into the file when I change it. Or, well, I try to. I forget most of the time. At least in theory, I should be able to use git smudge and clean filters to fix the files and insert the date of last update

How to automatically invoke a script before a git add?

陌路散爱 提交于 2019-12-04 16:28:00
问题 Here's my use case: I commit PNGs and other stuff in my Git repo. I would like to apply a specific process to every PNGs I would like to commit and this is the result of the process I finally want to commit (the potential modified PNG). At the beginning I thought about a hook (like a pre-commit ) but it's a little weird because the process will change the file so I will need to re-add it! And according to what I read, there is no pre-add hook (or something like that). May be a solution is to

Git clean/smudge filters for ansible vault secrets

一笑奈何 提交于 2019-12-04 13:57:57
问题 I am trying to setup clean/smudge filter in git to have automatic encrypting and decrypting of files containing secrets thru ansible-vault command. Peculiarity of the ansible-vault command is that it is not idempotent (it creates a different binary each time it is invoked on the same data). I started with the implementation suggested in this blog page. Unfortunately it did not work correctly, as whenever smudge is called (be it a git checkout , or just git status), the secret files looks as