2013-05-19 35 views
1

我開始使用EGit。我已經創建了一個初始倉庫,並且已經做了一些更改並承諾獲得版本2。然後,我回到最初的版本,並更改​​了一些文件,並承諾進行更改。我做了一些衝突合併,這是導致樹:退房時出現異樣行爲

enter image description here

奇怪的是,當我結帳從一個分支到另一個一些文件顯示未分級(「>」)。爲了解決這個問題,我重置了更改,但是當我檢查到另一個分支時,它又發生了。

如果我關閉Eclipse和我打開Git的擴展庫我可以檢出不同的分支,沒有任何問題。

有時,當我想重置Eclipse中的變化來消除這種「鬼改變」我不能因爲衝突對話框是一次又一次重新打開時,我按下復位按鈕做到這一點。

編輯:我張貼DIFF o一個文件。

diff --git a/MyApp/res/values/styles.xml b/MyApp/res/values/styles.xml 
index 79a39af..afe1d34 100644 
--- a/MyApp/res/values/styles.xml 
+++ b/MyApp/res/values/styles.xml 
@@ -1,13 +1,13 @@ 
<resources> 

    <!-- 
-  Base application theme, dependent on API level. This theme is replaced 
+  Base application theme, dependent on API level. This theme is replaced 
     by AppBaseTheme from res/values-vXX/styles.xml on newer devices. 
    --> 
    <style name="AppBaseTheme" parent="android:Theme.Light"> 
     <!-- 
-   Theme customizations available in newer API levels can go in 
-   res/values-vXX/styles.xml, while customizations related to 
+   Theme customizations available in newer API levels can go in 
+   res/values-vXX/styles.xml, while customizations related to 
      backward-compatibility can go here. 
     --> 
    </style> 

似乎差異是存在CRLF時。

+1

的「>」標記並不意味着「不變」,它意味着改變。你用什麼版本的EGit?你使用「core.autocrlf」設置嗎?顯示更改文件的差異是什麼(打開Git Staging視圖並雙擊更改)? – robinst

+0

是的,我的意思是「unstaged」而不是「不變」。我使用Egit 2.2的Eclipse Juno 4.2。當我比較文件時沒有區別。第一行突出顯示,但它們是相同的。 core.autocrlf是真的。 – Jesus

回答

1

如果core.autocrlf設置爲true,我會建議(as I usually do)將其設置爲false,並將行結束轉換限制爲core.eol directives in .gitattributes files

一旦core.autocrlf設置爲false,就可以檢查是否從一個分支到另一個還是讓那些「幽靈的變化」。

+0

自動修改其他原因:http://stackoverflow.com/a/13121378/6309 – VonC

+0

設置core.autocrlf解決了這個問題。謝謝。 – Jesus