Skip to content

Instantly share code, notes, and snippets.

Embed
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:
# https://confluence.atlassian.com/bitbucket/files/321848291/321979854/1/1360604134990/git_find_big.sh
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.