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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



`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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux