Skip to content

Instantly share code, notes, and snippets.

@vishalbhimani
Created May 30, 2020 08:59
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/42187a3baeeefc1129595bf1677ceb78 to your computer and use it in GitHub Desktop.
Save vishalbhimani/42187a3baeeefc1129595bf1677ceb78 to your computer and use it in GitHub Desktop.
Delete all commit history in github repository
#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
#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