Created
November 11, 2021 04:51
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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