1

I have my git with commit history like:

master    A--B
feature    \C--D

I wanted to merge feature branch into master, so I intended to rebase feature branch in order to have a clean commit history, and then make a merge request into the master.

But when I ran git rebase master, git required to resolve conflicts between C and B, then git add, then resolve between D and C, and git add again, which is exhausted. After that, the git log at local feature looked like A--B--C--D, which was what I wanted to be.

At that moment, I realized the local log was different from the remote counterpart, so I had to do git pull again, then resolve conflicts although the code looked the same.

Did I do something incorrect? Any suggestions about a standard, efficient way to merge a feature branch into the master branch?

Kevin1711
  • 51
  • 5
  • Could you also share the difference between your remote and local git history? – iambk Jan 26 '22 at 17:50
  • After applying multiple modification, I messed it up so I deleted the branch. Do you have any suggestions about a delicate way to merge a branch into master? – Kevin1711 Jan 29 '22 at 13:05

1 Answers1

0

then resolve conflicts although the code looked the same.

That is why in your scenario, it is interesting to activate git rerere, with git config rerere.enabled.

Use, as in here, rerere-train.sh in order to benefit from past resolution.

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