Git 删除远程仓库文件

来源:互联网 发布:松下空调 知乎 编辑:程序博客网 时间:2024/04/30 19:26

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

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

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

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

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

[plain] view plaincopy
  1. git rm -- cached "路径+文件名"  

    接下来:

[plain] view plaincopy
  1. git commit -m "delete file"  

    最后:

[plain] view plaincopy
  1. git push

5 0
原创粉丝点击