eclipse使用git合并_我怎样才能摆脱Eclipse Git的“冲突”?全部合并后的图标已解决?...

I get the Git conflict icon in Eclipse on lots of files, even though it seems that I resolved any possible conflicts.

In Eclipse 4.5.2, in the Project view, I select a project root and do right-click -> Compare to branch origin/master. Next, we see the Team Synchronization view. Many files show a red conflict icon., but they should not.

The Git staging view, which is supposed to show conflicts, is empty. I already tried Merge; Committing the merge (nothing remains to be committed). I tried Add to Index from the Git Staging view; and even Overwrite from the Team Synchronization view. Comparing the local and origin files shows that they are identical.

Git setting autocrlf is true, so that is not the issue.

This occurs repeatedly.

Why do I see this conflict icon? How can I get rid of it?

解决方案

Did you do a pull? Or where you just comparing in Team Synchronization? In my experience the Team Synchronization perspective confuses the most people.

In general it should be used "read-only". Don't try to resolve any conflicts here. Per default you are comparing your working copy against the remote repository. Which means you actually have no conflict in your working copy. When you "fix" them here you are just making a local modification. You can commit that but it doesn't resolve any conflict. It makes the actual conflict even harder to resolve.

So don't do anything in the Team Synchronization perspective. Just do a pull to have those conflicts in your working copy and then resolve them. A merge conflict is marked as merged by moving them to the Staged Changes.

If something breaks and you want a new try do a reset --hard on the last commit in your local repository.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值