Skip to content

Instantly share code, notes, and snippets.

@marschhuynh
Last active December 11, 2017 14:27
Show Gist options
  • Save marschhuynh/399a421daaa426d8325d0a85903938ee to your computer and use it in GitHub Desktop.
Save marschhuynh/399a421daaa426d8325d0a85903938ee to your computer and use it in GitHub Desktop.
List big file in git
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -10 | awk '{print$1}')"
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' \
--prune-empty --tag-name-filter cat -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment