Skip to content

Instantly share code, notes, and snippets.

@vishalbhimani
Last active May 30, 2020 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishalbhimani/f161c75d3e8e99f422bcc5bb4a34aa22 to your computer and use it in GitHub Desktop.
Save vishalbhimani/f161c75d3e8e99f422bcc5bb4a34aa22 to your computer and use it in GitHub Desktop.
Clear out the history of a git repository
// 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