2017-05-09 96 views
0

我繼續得到這些討厭的^M插入符號出現git diff。請注意,這些文件存儲在Linux上,但是通過Windows使用Samba共享網絡進行編輯。試圖擺脫他們,我執行每git-diff to ignore ^M如下:反向混帳配置命令

[[email protected] .git]$ git config --global core.whitespace cr-at-eol 

雖然^M不再顯示,更糟的是git diff仍顯示線爲不同的,但文字是兩條線相同因爲^M不再顯示。如何反轉core.whitespace cr-at-eol?我想我能看到git的配置文件中的變化,但不是這種情況。

[[email protected] .git]$ cat config 
[core] 
     repositoryformatversion = 0 
     filemode = true 
     bare = false 
     logallrefupdates = true 
[remote "origin"] 
     url = [email protected]:root/projextx.git 
     fetch = +refs/heads/*:refs/remotes/origin/* 
[branch "master"] 
     remote = origin 
     merge = refs/heads/master 

回答

1

當你使用--global,設置在~/.gitconfig,而不是在<repository>/.git/config
您也可以使用git config --show-origin -l來查看。
如果你不會使用--global,但是--local(或者什麼也沒有,因爲--local是默認值),它會在你想要的文件中。

要麼將​​其從該文件中刪除,要麼使用git config,如git config --global --unset core.whitespace