So, I am trying to rename a folder in my repository using git filter-branch --index-filter
, but I always end up with a \"fatal: bad source\" error.
The
git mv
is not really appropriate in an --index-filter
clause. Since --index-filter
does not check out each commit it's rewriting into the working directory, and git mv
operates on the working directory (in addition to the index), using git mv
in --index-filter
will not accomplish what is expected. Use a --tree-filter
instead. (It might be possible to accomplish this still with --index-filter
by using git update-index
instead, but I don't have that available off the top of my head).