Git Repo, there is a folder ABC
with three files, all having spaces in the name file - 1.ext
, file - 2.ext
, and file - 3.ext
.
Instead of using --index-filter
, try with --tree-filter
:
--tree-filter
This is the filter for rewriting the tree and its contents. The argument is
evaluated in shell with the working directory set to the root of the
checked out tree. The new tree is then used as-is
(new files are auto-added, disappeared files are auto-removed -
neither .gitignore files nor any other ignore rules HAVE ANY EFFECT!).
The commandline:
git filter-branch --tree-filter 'rm -rf path/to/ABC' \
--prune-empty --tag-name-filter cat -- --all