Skip to content

Instantly share code, notes, and snippets.

@despairblue
Created March 16, 2016 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save despairblue/8cfe4aa166b1aa016e60 to your computer and use it in GitHub Desktop.
Save despairblue/8cfe4aa166b1aa016e60 to your computer and use it in GitHub Desktop.
squash entire git history
# use at your own risk, might eat hamster and nose dragons
git branch -m master master-bak
git checkout --orphan master
git reset --hard
git commit --allow-empty -m 'init'
git merge --ff --squash master-bak
git commit --amend
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment