结帐时出现奇怪的行为

时间:2013-05-19 13:21:59

标签: eclipse git egit

我开始使用EGit。我已经创建了一个初始存储库,我已经做了一些更改并且提交了获取Version2。然后我回到初始版本并更改了一些文件,我提交了更改。我做了一些冲突的合并,这是结果树:

enter image description here

奇怪的是,当我从一个分支机构结账到另一个分支机构时,某些文件显示为未分级(“>”)。为了解决这个问题,我重置了更改,但是当我结帐到另一个分支时,它又重新发生。

如果我关闭Eclipse并在Git Extensions中打开存储库,我可以检查不同的分支而没有任何问题。

有时当我想重置Eclipse中的更改以删除此“ghost更改”时,我无法执行此操作,因为当我按下重置按钮时,冲突对话框会一次又一次地重新打开。

编辑:我发布文件差异。

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 个答案:

答案 0 :(得分:1)

如果core.autocrlf设置为true,我建议(as I usually do)将其设置为false,并将行尾转换限制为core.eol directives in .gitattributes files

一旦core.autocrlf设置为false,您就可以检查从一个分支到另一个分支是否仍会进行“重影更改”。