【发布时间】:2015-02-20 09:17:17
【问题描述】:
我曾经在做git commit 时得到warnings 关于LF will be replaced by CRLF。
我玩过autocrlf,但将其设置为true 或false 都会导致问题。最后,在@Drew Noakes 发表此评论 (LF will be replaced by CRLF in git - What is that and is it important?) 之后,我只是取消了它并修复了 warnings。
但是,现在,当我运行 git diff 时,我得到如下输出:
- original line;
+ new line;^M
发生了什么,有什么办法可以一劳永逸地摆脱这些讨厌的^Ms?
如果有帮助,这是我自己的存储库(即我可以完全控制代码库)并且我使用的是 Mac。
【问题讨论】:
-
你有
.gitattributes文件,里面有core.eol指令吗? -
@VonC 我没有,但我确实有一个带有
*.pbxproj -crlf -diff -merge的 .gitattributes 文件。我认为这与问题无关,因为它仅将其应用于 pbxproj 文件。
标签: git