1

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!

user3113633
  • 133
  • 1
  • 11
  • You may either rebase feature on master, or merge master into feature. – Tim Biegeleisen Dec 10 '18 at 03:47
  • @TimBiegeleisen thank you, will it distort the work tree? Do you mean checkout a master branch (or a new branch same as master) then do rebase feature? Ideally I would hope the tree will just be additional commits on top of current master? – user3113633 Dec 10 '18 at 03:55
  • have you check [How to resolve merge conflicts in Git](https://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-in-git), suggested many ways to achieve and also http://weblog.masukomi.org/2008/07/12/handling-and-avoiding-conflicts-in-git/ – ntshetty Dec 10 '18 at 04:03

1 Answers1

0

Do you mean checkout a master branch (or a new branch same as master) then do rebase feature?

No:

git checkout feature
git rebase master

Ideally I would hope the tree will just be additional commits on top of current master?

Exactly: it rewrites the feature branch on top of master, which changes the history of feature. So make sure you warn your colleagues working on that same branch.
And, as seen here, do activate git rerere to avoid having to resolve the same conflicts every time you are rebasing that branch on master.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250