Thread (7 messages) flat view 7 messages, 6 authors, 2021-09-30

Feature Request: `git commit --amend-to`

From: Aidan Gallagher <hidden>
Date: 2021-09-24 16:04:50

`git commit --amend` is very useful for adding changes to the previous
commit quickly.

Unfortunately, it is more difficult to add changes to older commits.
To do so I have to enter interactive rebase, mark the commit to
change, make the changes, amend the previous commit, and continue the
interactive rebase.

It would be nice if there was a single command to do this like `git
commit --amend-to SHA`

I have solved this issue for myself with this handy alias I found online
git config --global alias.amend-to '!f() { SHA=`git rev-parse "$1"`;
git commit --fixup "$SHA" && GIT_SEQUENCE_EDITOR=true git rebase
--interactive --autosquash "$SHA^"; }; f'
I think it would be beneficial if a command `git commit --amend-to`
could be officially added.

Thanks,
Aidan Gallagher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help