-
-
Save zorca/ae5834cdab8f72ab7752592e38f67b75 to your computer and use it in GitHub Desktop.
delete all commits from repo
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
git checkout --orphan latest_branch && \ | |
git add -A && \ | |
git commit -am "initial commit" && \ | |
git branch -D master && \ | |
git branch -m master && \ | |
git push -f origin master | |
Taken from | |
http://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github | |
Checkout | |
git checkout --orphan latest_branch | |
Add all the files | |
git add -A | |
Commit the changes | |
git commit -am "initial commit" | |
Delete the branch | |
git branch -D master | |
Rename the current branch to master | |
git branch -m master | |
Finally, force update your repository | |
git push -f origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment