How to remove a file permanently in Git without getting “WARNING: Ref 'refs/heads/master' is unchanged”?

前端 未结 2 634
暗喜
暗喜 2020-12-29 22:48

I have been googling and reading various posts around the net and I\'ve tried:

git filter-branch --index-filter \"git rm -rf --cached --ignore-unmatch Launcher

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-29 23:07

    I'm gonna put this here as a future reference since I had the same problem: If you use cmder (or other ConEmu flavors), use double quotes instead of single quotes.

    Also wrap the path in quotes if you have some white space in your address:

    git filter-branch --force --index-filter \
    "git rm --cached --ignore-unmatch 'server/bin/some file.txt'" \
    --prune-empty --tag-name-filter cat -- --all
    

    That was the problem when I got that error.

提交回复
热议问题