Merge old branch into new or new into old

Either approach would produce the same result from a code perspective, as long as you make the same merge-conflict resolution decisions when merging.

From a perspective of reading the git history, it makes more sense to merge the older branch into the newer, since you can more easily track the dates of commits, but that is just a user preference.

I would suggest, since management is in your way, to merge these two branches into a separate temporary third branch.

git checkout A # can checkout B as well
git checkout -b temporary-C-branch
git merge B # or A if you checked out B first. Also think about using --no-ff if you want a merge commit as well

That way you don’t have to mess-up A and B when merging.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top