这非常不直观:
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
如果我进行注释,警告就会消失。问题是 - 如何自动覆盖这个 .gitattributes
设置?
* text=auto
的快速导出进行斗争。这个方法解决了我的问题。如果可以的话,我会投10次赞成票! - spikyjt