Skip to content

Instantly share code, notes, and snippets.

@askalee
Last active June 21, 2018 09:26
Show Gist options
  • Save askalee/67c27efccf4231d1d33110add14a0a2e to your computer and use it in GitHub Desktop.
Save askalee/67c27efccf4231d1d33110add14a0a2e to your computer and use it in GitHub Desktop.
git: squash

Reference: http://zerodie.github.io/blog/2012/01/19/git-rebase-i/

Convert git log from

a   49687a0a646954afdf3f4dae1f914ea793341ea2
b1
b2  <== newest

to (combine b1 and b2 to a single b commit)

a
b
  • Step 1: rebase

    $ git rebase -i 49687a0a646954afdf3f4dae1f914ea793341ea2

  • Step2:squash

  • Step3: remove the result and make a new commit message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment