filter-branch --index-filter always failing with “fatal: bad source”

前端 未结 2 503
野趣味
野趣味 2020-12-11 03:56

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

2条回答
  •  时光取名叫无心
    2020-12-11 04:19

    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).

提交回复
热议问题