0

Merged one branch into my branch, but I reverted that merge. I merged again by

git checkout branch1
git merge branch2

but it says already up to date, however, I don't see any changes in my branch. It is still not merged and didn't have those merge conflicts as it had those earlier.

Spike
  • 23
  • 4
  • @torek Excellent canonical link, thank you! – matt Jun 19 '21 at 21:35
  • Spike: Your first merge moved the merge base; the revert does not change that. So without new commits on the branch you are indeed already up to date. — But even with new commits, and a second merge, you will not see the effects of the earlier branch commits in the second merge, because those commits are exactly what you merged in your first merge and then reverted. In effect you have said you never want those commits again! – matt Jun 19 '21 at 22:06
  • Thanks! I actually did ```git checkout branch1 ``` ```git reset --hard HEAD ``` ```git merge branch2 ``` I got commit_id from ```git reflog --oneline ``` – Spike Jun 21 '21 at 23:53
  • That might or might not be okay; after a hard reset you are pushing changed history to the server, which is usually a no-no. – matt Jun 22 '21 at 00:12

0 Answers0