Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
remove a large or sensitive file from git
# download and run this script in repo to list large files:
git filter-branch --force --index-filter \
'git rm -r --cached --ignore-unmatch FILEPATH' \
--prune-empty --tag-name-filter cat -- --all
git reflog expire --expire=now --all
git gc --prune=now
git push --all --force
git push --tags --force
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.