Skip to content

Squash commits with rebase

kengu edited this page Nov 16, 2012 · 1 revision
  1. Invoke interactive rebase of n last commits (replace n with a number)
git rebase -i HEAD~n
  1. Pick (keep) commits with command "pick" or "p"
  2. Squash commits together with command "squash" or "s"
  3. Save and exit editor
  4. Git performs given rebase
Clone this wiki locally