我继续使用^M
显示这些令人讨厌的git diff
插入符号。请注意,这些文件存储在Linux上,但是使用Samba共享网络通过Windows进行编辑。试图摆脱它们,我按照git-diff to ignore ^M执行了以下操作:
[Michael@devserver .git]$ git config --global core.whitespace cr-at-eol
虽然不再显示^M
,但更糟糕的是git diff
仍然显示该行不同,但由于^M
已不再显示,因此两行的文字相同显示。
如何撤消core.whitespace cr-at-eol
?我以为我能够看到git的配置文件中的更改,但不是这样。
[Michael@devserver .git]$ cat config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@xxx.com:root/projextx.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
答案 0 :(得分:1)
使用--global
时,设置位于~/.gitconfig
,而不是<repository>/.git/config
。
您也可以使用git config --show-origin -l
查看此内容
如果你没有使用--global
,但--local
(或者没有,因为--local
是默认值),它将出现在您要查找的文件中。
从该文件中删除它,或者更好地使用git config
之类的git config --global --unset core.whitespace
。