gitattributes

Specify custom gitattributes file location for git archive

允我心安 提交于 2019-12-14 02:35:06
问题 I'd like to expose git archive , but have a way for users to ask for some files or globs to be excluded, so the resulting archive file is not very big. Normally you'd write the file/glob list to .gitattributes and then run git archive . But this means only one person can ask for an archive per on-disk repository, since they have to write their ignore-export list to .gitattributes , then get the archive, before yielding to someone else. Also this means that whatever settings you had in there

Files without extensions in .gitattributes

本小妞迷上赌 提交于 2019-12-12 15:15:37
问题 I'm trying to address files without extensions in .gitattributes: * text=auto *. eol=lf .py eol=lf *. clearly doesn't help. git check-attr --all -- ./foo outputs: ./foo: text: auto How can this be done? 回答1: I think you have to set the value you want to all files, then remove the attribute for files with extension: * text=auto eol=lf *.* -eol # or set another default value *.py eol=lf It will give the result: $ git check-attr --all -- file file: text: auto file: eol: crlf $ git check-attr -

How to stop git from breaking encoding on checkout

心不动则不痛 提交于 2019-12-10 18:05:25
问题 I recently added a .gitattributes file to a c# repository with the following settings: * text=auto *.cs text diff=csharp I renormalized the repository following these instructions from github and it seemed to work OK. The problem I have is when I checkout some files (not all of them) I see lots of weird characters mixed in with the actual code. It seems to happen when git runs the files through the lf->crlf conversion specified by the .gitattributes file above. According to Notepad++ the

TeamCity's git checkout different from local git checkout

给你一囗甜甜゛ 提交于 2019-12-10 15:51:18
问题 I'm having a problem with TeamCity (8.1) running on a Windows box and one of our git repositories. Few files (2 out of 1000s - *.bytes extension, binary) have larger sizes on TeamCity checkout then on developer machines. If I turn off "Convert line-endings to CRLF" sizes for those files are the same, but then rest of the project does not build properly + developer machines do have core.autocrlf=true. I have also tried setting *.bytes as binary in .gitattributes but this looks like it is being

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

守給你的承諾、 提交于 2019-12-10 10:58:06
问题 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

What is the differrence between `* text=auto` and `* text eol=lf` in .gitattributes?

家住魔仙堡 提交于 2019-12-09 13:31:20
问题 I am looking again and again at the documentation of .gitattributes but I cannot find a clear answer on what is the differrence between these two: * text=auto * text eol=lf Also is text=auto intended only for use with * or it can also be used with specific extensions? In such a case what is the differrence? *.txt text=auto *.txt text eol=lf 回答1: TL;DR The eol=lf setting overrides any text setting, and since you have chosen to apply this to every path, only the eol=lf setting will matter, if

Enforce core.autocrlf=input through .gitattributes

孤街醉人 提交于 2019-12-09 11:20:27
问题 Is there a way to enforce core.autocrlf=input from within the .gitattributes in order to propagate the policy throughout my colleagues? In detail what I want is to convert to lf on add and leave as is on checkout . The problem is that neither text nor eol do what I want in .gitattributes since eol has 3 acceptable values: lf crlf native Ideally I would like my .gitattributes file to look like this: * text eol=asis 回答1: In detail what I want is to convert to lf on commit and leave as is on

.gitattributes merge driver is not used

為{幸葍}努か 提交于 2019-12-08 06:57:01
问题 At first, I know this question How do I tell git to always select my local version for conflicted merges on a specific file? but this post doesn't help me and I can't add any comments because of my reputation. http://git-scm.com/book/en/Customizing-Git-Git-Attributes suggests to set the merge strategy to ours for the path instead of setting a custom merge driver. What is the benefit and differene of adding a custom merge driver return an exit code 0? I have a .gitattributes file on my repos

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

两盒软妹~` 提交于 2019-12-07 18:28:34
问题 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 └──

Override .gitattributes text=auto in Windows

橙三吉。 提交于 2019-12-07 08:19:08
问题 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