Determines automatically on which commit to rebase when using git-commit --fixup or --squash and calls rebase --autosquash -i <hash> <command-line arguments>.
Git supports two ways of combining commits during a rebase, fixup and squash. The git-commit command has two corresponding options, called --fixup and --squash, to indicate that the new commit should be squashed or fixed up with the specified commit.
The git-rebase command supports --autosquash, which automatically modifies the todo list of the rebase so that commits marked for squashing or fixup comes right after the commit to be modified. It also changes the action from pick to fixup or squash.
Instead of calling rebase manually with the correct target commit, autosquash automatically determines on which commit to rebase and calls git rebase.
- Install Go.
- Set the
GOBINenvironment variable to wherego installwill install a command. - Install
autosquashby runninggo install autosquash.go.
Run autosquash in any git repository that has commits to fixup or squash. Any command line arguments passed to autosquash are passed to git rebase.
Autosquash is MIT licensed, see the LICENSE file.