如何在Git中永久删除文件而不会收到“WARNING:Ref'refs / heads / master'保持不变”? [英] How to remove a file permanently in Git without getting "WARNING: Ref 'refs/heads/master' is unchanged"?

查看:1947
本文介绍了如何在Git中永久删除文件而不会收到“WARNING:Ref'refs / heads / master'保持不变”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



git filter-branch --index-filter git rm -rf --cached --ignore-unmatch Launcher \lib--prune-empty - --all





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



所有产生的结果如下:


警告:Ref'refs / heads / master'不变


这个存储库还有其他的克隆以及一个中央服务器。据我所知,我会将更改推送到服务器,其他克隆只需获取并重新绑定(不合并)?如果他们已经做出改变,它仍然可以工作吗?

解决方案

好的,我解决了这个问题,这是错误的路径。我改变了这个:

Launcher \lib



to this:

Launcher / lib /



现在它工作;)


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?

解决方案

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

这篇关于如何在Git中永久删除文件而不会收到“WARNING:Ref'refs / heads / master'保持不变”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆