Last Updated: February 25, 2016
·
346
· rajeshpg

remove file from git history

$ git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch <file path>' --prune-empty --tag-name-filter cat -- --all

$ git push -u origin master --force

$ rm -rf .git/refs/original

$ git reflog expire --expire=now --all

$ git gc --prune=now

$ git gc --aggressive --prune=now