2013-02-14 82 views
2

不知何故,當提交更改時,git將文件顯示爲「已刪除」,並將相同的文件顯示爲「已添加」,而不是顯示差異。 例如:爲什麼git將文件顯示爲已刪除而不是差異?

( - )FILE.TXT

- hello world 
- this is amazing 
- some more text 

(+)file.txt的

+ hello world 
+ this is amazing 

代替表示

(+ - )FILE.TXT

hello world 
this is amazing 
- some more text 

做喲你有什麼想法是什麼造成這個?我不知道這個提交是如何提交的,但它看起來像是失去了三角洲的蹤跡。

+0

'git'從來沒有像顯示這些信息,尤其是'(+ - )'。如果您顯示實際的信息,我們可能會回答您的問題。 – mvp 2013-02-14 07:52:21

回答

1

這是因爲不同的行結尾而發生的。你需要告訴混帳來處理分歧:

$ git config --global core.autocrlf input
# Set this setting on OSX or Linux

$ git config --global core.autocrlf true
# Set this setting on Windows

相關問題