I want to use extended globbing in an "index-filter" , e.g.
git filter-branch --index-filter "git rm --cached --ignore-unmatched Modules/!(ModuleA|ModuleB)"
but I get an error:
eval: line 336: syntax error near unexpected token `('
I already tried:
git filter-branch --index-filter "shopt -s extglob && git rm --cached
--ignore-unmatched Modules/!(ModuleA|ModuleB)"
So the general question is: how do I enable specific shell options for the shell used to evaluate these expressions?