The following uses some complex git
commands, so it should be undertaken with caution. That said, the mechanisms involved are fairly straightforward so someone reasonably familiar with git
should be able to follow along. While it is possible to mess up your local checkout, nothing below is destructive, and you should be able to reference all your original commits by hash were something to go wrong.
Let's say you are working on a big feature with changes A
, B
and C
, which you want to merge incrementally. Initially your commit graph would look something like this: