Last active
August 29, 2015 14:11
-
-
Save zyzo/98d614eed25b4173c9b4 to your computer and use it in GitHub Desktop.
Step to remove completely a file and its histories from git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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