What is an "Interactive Rebase," and when would you use "Squash" vs. "Fixup"?

Last updated 6 July 2026

  • Interactive rebase (git rebase -i) opens a to-do list to reorder, edit, reword, drop, or combine commits. It is used to clean up local history before sharing.

  • squash folds a commit into the previous one and lets you combine both messages. Use it when both messages are worth keeping.

  • fixup folds a commit into the previous one but discards its message. Use it for small corrections like typos or a missed file.

  • https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
  • https://git-scm.com/docs/git-rebase/pt_BR
  • https://git-scm.com/docs/git-rebase/2.49.0
  • https://www.freecodecamp.org/news/git-squash-explained/
  • https://forum.freecodecamp.org/t/how-to-squash-multiple-commits-into-one-with-git-squash/13231
  • https://forum.freecodecamp.org/t/git-rebase-explained-how-to-use-it-and-how-git-rebase-works/13226
  • https://dev.to/sylwia-lask/10-git-commands-youll-wish-you-knew-earlier-4fcp
All Git interview questions