Created
December 22, 2017 13:23
-
-
Save Kapott/b43bb97f3c2e14dd4264f9ecb69e5a48 to your computer and use it in GitHub Desktop.
Completely wipe a git repo's history. For those 'oh shit' moments.
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/bash | |
# remove git information | |
rm -rf .git | |
# re-initialize git with current state | |
git init | |
git add . | |
git commit -m "Initial commit" | |
# push to the repo, ensuring you overwrite all history | |
git remote add origin git@github.com:kapott/<INSERT_REPO_HERE>.git | |
git push -u --force origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment