Let's say that I have the following three commits:
c - Third Commit
b - Second Commit
a - First Commit
I use the following commands to perform the interactive rebase (as described in another StackOverflow thread)
$ git rebase --interactive bbc643cd^
In the default editor, modify 'pick' to 'edit' in the line whose commit you want to modify. Make your changes and then commit them with the same message you had before:
$ git commit --all --amend --no-edit
to modify the commit, and after that
$ git rebase --continue
The problem is that sometimes, when I'm done, the commits have been squished into one single commit (the oldest commit, a
in my example).
It seems that it may have something to do with when there are merge conflicts to resolve, so I suspect I may be continuing incorrectly after resolving. After resolving merge conflicts, I'm unsure about whether I need to simply do git rebase --continue
or both $ git commit --all --amend --no-edit
AND git rebase --continue
. It seems like in both cases, I've had merged commits at the end, but I'm not sure.
What am I doing wrong?