3

I have performed the following merge:

A---B---C---E (HEAD, merge of C and D)
           /
      D---|

But I noticed some issues in E, and fixed them in F:

A---B---C---E---F (HEAD)
           /
      D---|

I want to modify commit E so that it contains the "fixup" changes made in F.

When I try git rebase -p -i HEAD~2, it tries to create a regular (not merge) commit, and even tries to make me re-resolve the conflicts I already resolved when performing the merge for E.

How do I fixup commit E so it contains the changes made in F?

Romain Valeri
  • 19,645
  • 3
  • 36
  • 61
Craig Otis
  • 31,257
  • 32
  • 136
  • 234

1 Answers1

5
git reset --soft E
git commit --amend

should be enough. It'll recreate a merge commit (with a different hash than E, let's call it E') while inserting whatever changes you made between E and F.

Romain Valeri
  • 19,645
  • 3
  • 36
  • 61