How to squash commits 1. Rebase using interactive editor. N = last N commits to be squashed into one commit. > git rebase -i HEAD~N 2. Let the first commit marked with "pick". Then "squash" the rest. Use "fixup" to discard that particular commit message. 3. Force push > git push --force-with-lease