简体   繁体   English

使用Eclipse合并git中的冲突

[英]Merge conflict in git using eclipse

Hi I am facing a merge conflict using git in eclipse. 嗨,我在Eclipse中使用git面临合并冲突。

Basically I am trying to synch two branches ie branch A and branch B. So while synching Branch B with branch A conflicts occurred. 基本上,我试图同步两个分支,即分支A和分支B。因此,在将分支B与分支A同步时发生冲突。 Hence to resolve these conflicts all the files have been marked as merged and has been committed and pushed. 因此,为解决这些冲突,所有文件都被标记为已合并,并且已提交并推送。

But again while synching with branch B with branch A the same files are shown in conflicts mode with no changes shown in files diff.. 但是同样,当与分支B与分支A同步时,在冲突模式下将显示相同的文件,而文件diff。中未显示任何更改。

Can anyone suggest how to resolve this issue? 谁能建议如何解决这个问题?

Before merging your changes from branch B(ex: development) to branch A(ex: master), get the latest changes from the branchA to branchB and resolve the conflicts 从分支B(例如:开发)到分支A(例如:母版)的更改合并之前,获取从分支A到分支B的最新更改并解决冲突

 $ git checkout branchB  # Ignore this if you've already in the branchB

 $ git merge branchA  # This will merge recursively and show conflicts if any. so resolve the conflicts and commit on 'branchA"

 $ git commit -m "resolving conflicts and merging from branchA to branchB"

 $ git checkout branchA  # Assuming this is master branch 

 $ git merge branchB  # Now this shouldn't show any conflicts since it's resolved earlier

Now branchA and branchB both are having the same changes! 现在branchA和branchB都具有相同的更改!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM