One of the most useful things I learned for my workflow is git commit —fixup - because often enough I know in advance what is just a correction of a previous commit. I can then automatically cleanup history with git rebase —autosquash.
Because fixup also works for other commits in the history. Like when I am working on a branch with multiple commits that represent different logical changes and I find an issue with it. Then I can fixup the commit it belongs to and retain a clean history.
One of the most useful things I learned for my workflow is git commit —fixup - because often enough I know in advance what is just a correction of a previous commit. I can then automatically cleanup history with git rebase —autosquash.
Why not just ammend it to the previous commit?
Because fixup also works for other commits in the history. Like when I am working on a branch with multiple commits that represent different logical changes and I find an issue with it. Then I can fixup the commit it belongs to and retain a clean history.
(Of course I am talking about multiple commits that have not yet been merged anywhere else)