Skip to content

Instantly share code, notes, and snippets.

@xingh
Last active October 26, 2016 22:02
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 xingh/8e76428ada1b0144ab33f13a70ab2e66 to your computer and use it in GitHub Desktop.
Save xingh/8e76428ada1b0144ab33f13a70ab2e66 to your computer and use it in GitHub Desktop.
How to Clean Dirty files from a Git Repository
  1. I made a backup of all branches and the bare repo ( zipped up and put on Dropbox of each directory )

git clone -b <branch> http://<gitlocation>

git clone http:<gitlocation>

git clone --mirror http:<gitlocation> (bare repo)

  1. I went into the regular clones ( not bare repo ) and deleted all the dirty files from the file system then I did git add . , made a commit and pushed the repo.

  2. Then I used the instructions on here.

https://rtyley.github.io/bfg-repo-cleaner/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment