-
-
Save mvuorre/5d8529e3e7f5df95e2fedccfcdda2894 to your computer and use it in GitHub Desktop.
Steps to clear out the history of a git/github repository
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
-- Delete .git folder from disk | |
rm -rf .git | |
-- recreate the repo from the current content only (note old .gitignore is preserved) | |
git init | |
git add . | |
git commit -m "Initial commit" | |
-- push to the github remote repo ensuring you overwrite history | |
git remote add origin https://github.com/<username>/<reponame>.git | |
git push -u --force origin master |
i got frustrated for couple hours and i found your post. Many thanks sir. Saved my day.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Small edit to make it work