Remove File From Git History

April 30, 2010 – 1:55 pm

Useful stuff.

git filter-branch -f --index-filter 'git update-index --remove filename' HEAD
git push --force --verbose --dry-run
git push --force

Slight better version. Only rewrites history from the first commit the file existed.

git filter-branch -f --index-filter 'git update-index --remove filename' ..HEAD
git push --force --verbose --dry-run
git push --force

Found on github.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit

Post a Comment