-
-
Save danielcharrua/564ca15128ea16c70cdee48084e619e6 to your computer and use it in GitHub Desktop.
Git remove all commits except the current one
This file contains hidden or 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
#!/usr/bin/env bash | |
rm -rf .git | |
git init | |
git add . | |
git commit -m "Initial commit" | |
git remote add origin <git origin url> | |
git push -u --force origin <branch> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment