What is rebase autosquash, and how does it work together with fixup/squash commits?

Last updated 6 July 2026

  • Mark fix commits with git commit --fixup=<hash> or --squash=<hash>, which prefix the message with fixup! or squash! plus the target commit's subject.

  • git rebase -i --autosquash matches those prefixes, moves each fix right beneath its target, and presets the fixup or squash action automatically.

  • This avoids manual reordering. Enable it by default with rebase.autosquash true.

  • https://elver.me/blog/fixing-commits-with-git-commit-fixup-and-git-rebase-autosquash/
  • https://dev.to/mbrehin/git-autofixup-5b3g
  • https://github.com/sourcegit-scm/sourcegit/issues/588
  • https://resources.criodo.com/resources/git-interactive-rebase/
  • https://medium.com/@acparas/git-fixup-autosquash-and-commit-msg-heading-34da171fbcbb
  • https://congtuanle.medium.com/git-the-power-of-fixup-autosquash-f1c91f7d962b
  • https://git-scm.com/docs/git-rebase
  • https://blog.gitbutler.com/git-autosquash
All Git interview questions