Created
January 12, 2017 08:36
-
-
Save i026e/b3d34f2795e5abec3f0205d4d518dffe to your computer and use it in GitHub Desktop.
clear history
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 sh | |
#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 "clear history" | |
#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