Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Step to remove completely a file and its histories from git
1. Delete file from git repository
1. Download bfg.jar from http://rtyley.github.io/bfg-repo-cleaner/
2. mirror clone the project
$ git clone --mirror git://example.com/my-repo.git
3. Run
$ java -jar bfg.jar --delete-files fileToDelete my-repo.git
4. Update
$ cd my-repo.git
$ git reflog expire --expire=now --all && git gc --prune=now --aggressive
5. Finally, push it back up :
$ git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.