首页 > 解决方案 > git如何合并与master冲突的分支

问题描述

I have a problem here: I have a branch feature in development and it posts a decent number of conflicts with master branch. I would like to make a pull request in the future to merge it with master.

Right now, I would hope to resolve some conflicts with master (not planning to merge yet). Will there be a recommended way for me to do that? I am thinking about creating a new branch with the up-to-date master and either cherry-pick or pull the feature branch and resolve conflict accordingly. Is that the right way? Also, in the future after more master pushes, should I redo the same process to resolve conflict? Thank you!

标签: git

解决方案


你的意思是检查一个主分支(或一个与主分支相同的新分支)然后做变基功能?

不:

git checkout feature
git rebase master

理想情况下,我希望这棵树只是当前主节点之上的额外提交?

确切地说:它重写了feature之上的分支master,从而改变了feature. 因此,请务必警告在同一分支上工作的同事。
并且,如此处所见,请务必激活git rerere以避免每次将该分支重新基于master.


推荐阅读