I'm trying to run this command:
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch filename.js' --prune-empty --tag-name-filter cat -- --all
but I keep getting this error:
fatal: ambiguous argument 'rm': unknown revision or path not in the working tree
.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
It depends on the shell you are using.
On Windows, with msysgit for instance, see issue 477:
Multiple lines:
As mentioned in "How to pass a programmatically generated list of files to
git filter-branch
?"So make sure
'git rm --cached --ignore-unmatch filename.js'
is considered a string in the shell you are in.