2
这是很直观:覆盖.gitattributes文本=自动在Windows
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 commit message.
据各种媒体core.autocrlf=false
应该没有换行转换的。
在项目的根,我发现.gitattributes
与线:
# Auto detect text files and perform LF normalization
* text=auto
如果我评论它,警告消失。这个问题 - 我如何自动覆盖这个.gitattibutes
设置?
如果GIT有一些选项将EOL转换完全关闭,无论.gitattributes文件如何,那将会很好。在我的情况下,.gitattributes文件由RE维护,我无法更改它,但我绝对希望只使用LF在我的PC上存储所有文件。 –
非常感谢。我花了很多年的时间与设置了'* text = auto'的快速导出进行对抗。这个伎俩。如果可以的话,我会投票10次! – spikyjt
@AndreiLED您可以通过编辑/添加.git/info/attributes来覆盖此回购。优先顺序是全局配置 - > .gitattributes在dir - > .git/info/attributes中(即后者采用最高优先级并覆盖其他优先级)。参考这里:http://git-scm.com/docs/gitattributes – spikyjt