Skip to content

Instantly share code, notes, and snippets.

@danieltomasz
Created January 19, 2018 20:04
Show Gist options
  • Save danieltomasz/48670d8104c7e4db5e1a623fa0003498 to your computer and use it in GitHub Desktop.
Save danieltomasz/48670d8104c7e4db5e1a623fa0003498 to your computer and use it in GitHub Desktop.
Steps to clear out the history of a git/github repository. source: https://stackoverflow.com/a/13102849
git checkout --orphan newBranch
git add -A # Add all files and commit them
git commit
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
git push -f origin master # Force push master branch to github
git gc --aggressive --prune=all # remove the old files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment