Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== completely remove a file from all revisions ====== If you've added a file to a .gitignore list and it still shows up for commits, you can ignore it from that point on by removing it with this: <code> git rm --cached <file> </code> If you find a file that should never have been committed into the repo, you need to do more than this. 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** <code> git filter-branch --index-filter 'git rm --cached <file>' HEAD </code> **method 2** <code> git filter-branch -f --index-filter 'git update-index --remove filename' HEAD </code> ===== External Links ===== * http://www.gitready.com/beginner/2009/03/06/ignoring-doesnt-remove-a-file.html * http://github.com/guides/completely-remove-a-file-from-all-revisions docs/git/completely_remove_a_file_from_all_revisions.txt Last modified: 2010/02/24 10:47by billh