I used to use gitx to stage changes for commit, but I have switched to a purely terminal workflow + Fugitive.vim. One feature that I really miss from gitx though is the ability to make an adjustment in a previous commit. For example, if some section was added in a previous commit, but shouldn't have been, gitx makes it really easy to pull out that section and just amend the previous commit.
My current workflow for making such a change is:
git show
- Copy the commit message
git reset --soft HEAD^
- Use Fugitive or
git add -i
to make whatever change I want to make git commit
- Paste the previously copied commit message
- Confirm
What previously was a convenient two step process has now become pretty cumbersome. Is there some other way to do this that I'm missing?
git commit --amend -CHEAD --interactive
seemed promising to me, but it doesn't seem to work at all.
To accomplish the same task I use the following approach:
Please, tell me if it works for you too.