Delete file from git history completely

Run the following code:

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch file-path'

Alternatively:

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch app/views/index.html.erb' --prune-empty --tag-name-filter cat -- --all

Learn more: http://stackoverflow.com/a/23188613

Leave a Reply

Your email address will not be published.