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

Tower picture Tower · Feb 11, 2012 · Viewed 14.9k times · Source

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\lib" --prune-empty -- --all

and

git filter-branch --tree-filter "rm -rf Launcher\lib" --prune-empty -- --all

All resulting in a:

WARNING: Ref 'refs/heads/master' is unchanged

There are other clones of this repository and a central server also. I will push changes to the server, as I understand, others with clones just need to fetch and rebase (not merge)? Would it still work if they have made changes?

Answer

Tower picture Tower · Feb 11, 2012

Okay I solved the problem, it was the path that was wrong. I changed this:

Launcher\lib

to this:

Launcher/lib/

and now it works ;)