I understand that the correct way of amending an old Git commit is to use rebase --interactive
, but just to get clear on the concepts, I would like to understand what happens when I do
git checkout <commit>
- change something in a file
- add the changed file to the index
- and then
git commit . --amend
When I do this, instead of amending the commit, it branches a new commit off of the PARENT of that same commit.
Is this just Git's way of telling me that I cannot amend a commit that already has children commits?