Last active
May 30, 2020 08:48
-
-
Save vishalbhimani/f161c75d3e8e99f422bcc5bb4a34aa22 to your computer and use it in GitHub Desktop.
Clear out the history of a git 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
// Remove the history from repository | |
rm -rf .git | |
// initialise your new Git repo | |
git init | |
// places files in a special staging area | |
git add . | |
// make a commit with message | |
git commit -m "Initial commit" | |
// push to the github remote repos ensuring you overwrite history | |
git remote add origin <REPOSITORY URL> | |
git push -u origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment