Previously I wrote about git rebase --interactive --autosquash,
and showed a couple of helper aliases to aid in creating the specially
formatted commit messages used by --autosquash.
In 1.7.4, Git gained built-in versions of these helpers (specifically
in d71b8ba and 89ac122). It is now
possible to use the commit command directly (or much more simple
aliases) to create fixup and squash commits for use with
--autosquash.
The built-in way to create a squash commit now looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Creating a fixup commit works just the same (substituting --squash
with --fixup in the commit command), though Git won’t automatically
pop open the editor to ask for additional information in the commit
message (as this would be discarded by the interactive rebase). When
using --squash the commit message options can also be used (Ex:
-m, -c, -C, and -F).
Finally, here are the updated aliases for fixup, and squash made
much more simple by these new flags to commit:
1 2 3 4 | |
Update (2012-10-25): Fix aliases to have same usage pattern as previous ones.