Things I search always search for when working with Git
Je Sian Keith Herman July 26, 2013 Updated: April 25, 2024 #Git #ToolsFrequently Asked Questions
How can I remove/delete a large file from the commit history in the Git repository?
Use the BFG Repo-Cleaner, a simpler, faster alternative to git-filter-branch, specifically designed for removing unwanted files from Git history.
Carefully follow the usage instructions. The core part is just this:
Any files over 100 MB in size (that aren't in your latest commit) will be removed from your Git repository's history. You can then use
git gcto clean away the dead data:&&After pruning, we can force push to the remote repo*
Note: cannot force push a protect branch on GitHub
The BFG is typically at least 10-50 times faster than running
git-filter-branch, and generally easier to use.Full disclosure: I'm the author of the BFG Repo-Cleaner.
— Roberto Tyley (on StackOverflow)