码迷,mamicode.com
首页 > 系统相关 > 详细

git rm与git rm --cached

时间:2019-05-09 21:56:55      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:需要   使用   工作区   remote   文件   comm   git   file_path   版本   

当我们需要删除暂存区分支上的文件, 同时工作区也不需要这个文件了, 可以使用

1 git rm file_path
2 git commit -m ‘delete somefile‘
3 git push

当我们需要删除暂存区分支上的文件, 但本地又需要使用, 只是不希望这个文件被版本控制, 可以使用

git rm --cached file_path
git commit -m ‘delete remote somefile‘
git push

 

git rm与git rm --cached

标签:需要   使用   工作区   remote   文件   comm   git   file_path   版本   

原文地址:https://www.cnblogs.com/qqhfeng/p/10841071.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!