Skip to content

Instantly share code, notes, and snippets.

@arnabmitra
Created July 5, 2016 15:50
Show Gist options
  • Save arnabmitra/c339b2035da0544bf74d0cade73cdc62 to your computer and use it in GitHub Desktop.
Save arnabmitra/c339b2035da0544bf74d0cade73cdc62 to your computer and use it in GitHub Desktop.
What if you want to squash all your commits to one commit
git rebase -i d670953
git log --oneline
pick b76d157 b
pick a931ac7 c
# Rebase df23917..a931ac7 onto df23917
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
pick b76d157 b
s a931ac7 c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment