Skip to content

Instantly share code, notes, and snippets.

@StudioEtrange
Created November 11, 2021 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StudioEtrange/0da5c6536c539746098e3a8dbaa9b67c to your computer and use it in GitHub Desktop.
Save StudioEtrange/0da5c6536c539746098e3a8dbaa9b67c to your computer and use it in GitHub Desktop.
will crush all commits history to one then push and erase the remote branch master on github
#!/bin/sh
# will crush all commits history to one
# then push and erase the remote branch master on github
# https://stackoverflow.com/a/15572071
git branch new_branch $(echo "init message" | git commit-tree HEAD^{tree})
git push --force <remote url> new_branch:master
# delete local folder and re-clone thge project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment