This is an old revision of the document!


completely remove a file from all revisions

You find a file that should never have been committed into the repo. Adding the file to a .gitignore list doesn't get rid of it for you, and you want the file to disappear from everything. (probably a good idea to back up repo before doing this)

method 1

git filter-branch --index-filter 'git rm --cached <file>' HEAD

method 2

git filter-branch -f --index-filter 'git update-index --remove filename' HEAD
  • docs/git/completely_remove_a_file_from_all_revisions.1267033303.txt.gz
  • Last modified: 2010/02/24 10:41
  • by billh