Skip to content

Instantly share code, notes, and snippets.

@majindageta
Created April 10, 2020 09:52
Show Gist options
  • Save majindageta/26be37901cd7dcbb72073c42ecc6f073 to your computer and use it in GitHub Desktop.
Save majindageta/26be37901cd7dcbb72073c42ecc6f073 to your computer and use it in GitHub Desktop.
download https://rtyley.github.io/bfg-repo-cleaner/
clone `git clone --mirror git://example.com/some-repo.git`
if your files to delete are in the last "master" commit, delete the file and push
.
The last master commit is always preserved so you need to make another commit.
then `bfg --delete-files filename.txt my-repo.git`
my-repo.git is the name in your folder
finally
`cd some-big-repo.git`
`git reflog expire --expire=now --all && git gc --prune=now --aggressive`
in the end
`git push`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment