我有一個包含C#代碼的git存儲庫,並且我在Windows上運行的是MSysGit
。更改文件中的一個字符導致MSysGit認爲整個文件已更改
core.autocrlf
被打開,而我利用this question的.gitattributes
,並作爲在this Github guide的底部所提及的我「renormalised」我回購。
現在對於的的.cs文件在我的倉庫的一些,如果我改變甚至一個字,MSysGit
認爲整個文件已經改變。
我克隆了新鮮的倉庫。我試圖先在Visual Studio中編輯文件,但後來我試圖在SciTE中打開它,它顯示了行結尾和製表符,並且我相信它不會對文件做任何奇怪的事情(如更改編碼)。
所以,我克隆庫新鮮:
$ git clone git clone [email protected]:my-repo.v2.git
$ cd my-repo/
我檢查庫和文件:我開在賽特文件
$ git status
# On branch master
nothing to commit (working directory clean)
$ git diff path/to/myfile.cs
$
(注意行結束CRLF
有沒有標籤):
using System;
using System.Collections.Generic;
...
並改變一個字符(並且注意CRLF
,無標籤仍然如此):
using System;
!using System.Collections.Generic;
...
現在混帳認爲一切都改變了:
$ git diff path/to/myfile.cs
diff --git a/path/to/myfile.cs b/Dpath/to/myfile.cs
--- a/path/to/myfile.cs
+++ b/path/to/myfile.cs
@@ -1,116 +1,116 @@
-<U+FEFF>using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Practices.EnterpriseLibrary.Data;
-using DataModel.Models;
-using DataModel.Mappers.Interfaces;
-using System.Data.Common;
-using System.Data;
...
常規差異程序並不認爲這兩個文件是如此的不同,git diff
在Unix上沒有按認爲他們太不同了,但msysgit
呢。
有沒有人遇到過這個或有任何想法?
當我重新啓動計算機時問題得到解決。 *嘆*。 –