您的位置:首页 > 其它

Git 删除远程仓库文件

2018-01-10 10:40 477 查看
Git 删除远程仓库文件

原文地址:http://blog.csdn.net/u010316858/article/details/50053387

         使用 git rm 命令即可,有两种选择.

         一种是 git rm --cached "文件路径",不删除物理文件,仅将该文件从缓存中删除;

         一种是 git rm --f "文件路径",不仅将该文件从缓存中删除,还会将物理文件删除(不会回收到垃圾桶)

    假如你有文件不小心commit到了服务器那么你想要删除它,可以使用:

[plain] view
plaincopy

git rm -- cached "路径+文件名"  

    接下来:

[plain] view
plaincopy

git commit -m "delete file"  

    最后:

[plain] view
plaincopy

git push
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息