Created
June 2, 2019 04:51
-
-
Save manparvesh/033aef080542b986f4bdbf3f3366010e to your computer and use it in GitHub Desktop.
Git remove all commits except the current one
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
#!/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
Worked for me