【发布时间】:2017-11-08 08:16:36
【问题描述】:
我在 unstaged 文件中有一个 maven 文件 mvnw.cmd,但没有真正的修改。在我看来,它与 EOL 有关,因为每一行都被标记为删除和添加。
我已经尝试从 GIT 中删除并再次取出它。我试图把它藏起来,但它仍然是未暂存的文件。
.gitattributes 文件:
# Auto detect text files and perform LF normalization
* text=auto
# Make sure that the line ending style ist set to Linux for shell scripts
*.sh eol=lf
# Make sure that the line ending style ist set to Windows for bat scripts
*.bat eol=crlf
*.cmd eol=crlf
提前谢谢你。
【问题讨论】:
-
好的,但是该文件在存储库中有什么样的行尾?使用
hexdump或一些将显示行尾或十六进制的编辑器。它可能在存储库中有不正确的行尾,除了您的gitattributes之外还需要更正。
标签: git batch-file eol gitattributes