Created
January 29, 2017 19:52
-
-
Save sebdi/fa9b87e2d1807c95a63b1bcea011c141 to your computer and use it in GitHub Desktop.
Delete git 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
| # 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment