Reset repo history in Git
After doing a lot of pushed to a repo in github the cloning becomes slower and slower specially if you have images or media files that are generated everytime. Sometimes we don't actually care about the history of the repo, so thats what is this post about, deleting a repo's history. I use this for OnToology testing.
- Checkout
git checkout --orphan latest_branch
- Add all the files
git add -A
- Commit the changes
git commit -am "commit message"
- 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
If you have a better way, please do not hesitate to share it ;)
Resource: copied as is from: http://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github
Resource: copied as is from: http://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github
Comments
Post a Comment