I accidentally added a huge file to my repo (~250 MB) with the name --exclude
. This file was generated on OS X while I was writing some new code for this repo. Now, I was trying to learn how to delete it from Git's history from here and here. The tutorials are nice and clear, but the problem is that Git "thinks" --exclude
is not a file but an option.
When I run this command:
git filter-branch \ --index-filter "git rm -r --cached --ignore-unmatch '--exclude' " HEAD
Git complains:
error: unknown option `exclude'
usage: git rm [<options>] [--] <file>...
I tried to use file's sha number but it changed nothing.What is the correct way to delete such a files?