git删除远程仓库文件

来源:互联网 发布:大数据高并发优化 编辑:程序博客网 时间:2024/05/17 23:17

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

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

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




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

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

     git commit -m "delete file" 

     git push



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

     git commit -m "delete file" 

     git push


原创粉丝点击