Skip to content

Instantly share code, notes, and snippets.

@shunfan
Last active August 20, 2018 20:04
Show Gist options
  • Save shunfan/8d1b9ba1dc8409ba809072de952cd130 to your computer and use it in GitHub Desktop.
Save shunfan/8d1b9ba1dc8409ba809072de952cd130 to your computer and use it in GitHub Desktop.
Git Snippets
Squash commits on branch into one commit:
git log --oneline
git rebase -i HEAD~<number of commits back to include + 1>
# leave extra commit as "pick"
# leave oldest commit for this branch as "pick"
# change all others to s
# save and exit
# edit commit message
git push —force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment