git rebase -i --autosquash HEAD~5

Category: Git - Advanced

git rebase -i --autosquash HEAD~5

Rebase and automatically squash fixup commits

Runs an interactive rebase and automatically moves fixup! commits to squash with their targets. --autosquash handles the arrangement.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.