Reputation: 345
I've got the master branch and another branch let's say B which is a fork of the master. The B branch was experimental and underwent a lot of modifications but was left stale for a year. Master branch has moved a lot forward during that year with countless commits.
But now the situation wants the B branch merged into the master one. Which strategy is best in this situation, a git merge or rebase ?
Upvotes: 3
Views: 1814
Reputation: 23322
A straightforward merge may be problematic if there's a lot of work to be merged, and you want to do it progressively (in order to test the results).
You could try to repeatedly rebase to newer versions of the master, until you finally reach the tip. Note that you don't need to rebase B itself (in case it's public) - simply make a copy of B and rebase it.
Another tool that is worth knowing about in these situations is git's rerere
Upvotes: 1