how to remove git history for a file
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD
how to remove git history for a file
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD
git remove files from old commits
git filter-branch --index-filter
'git rm --cached --ignore-unmatch path/to/mylarge_file'
--tag-name-filter cat -- --all
filter-branch keeps backups too, so the size of the repo won't decrease immediately unless you expire the reflogs and garbage collect:
rm -Rf .git/refs/original # careful
git gc --aggressive --prune=now # danger
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us