这是Override .gitattributes text=auto in 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.
其他问题询问如何覆盖.gitattributes
,而我想知道为什么警告发生。
根据文档,text = auto执行规范化,即更改CRLF - >办理登机手续时的LF。它不应该在另一个方向触摸文件。换句话说,它应该表现得像core.autocrlf = input
一样。
那警告是什么? Git想要改变LF - > CRLF在我的工作目录中? (这没有意义。)或者它是否告诉我LF将在存储库中? (在这种情况下,消息读错了,不是吗?)