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

git rm And git rm --cached And git reset HEAD

时间:2017-06-05 00:27:28      阅读:405      评论:0      收藏:0      [点我收藏+]

标签:本地   文件   str   eset   目录   硬盘   file   --   php文件   

git rm

git rm 会将条目从缓存区中移除。这与 git reset HEAD 将条目取消缓存是有区别的。 "取消缓存"的意思就是将缓存区恢复为我们做出修改之前的样子。

 

默认情况下,git rm file 会将文件从缓存区和你的硬盘中(工作目录)删除。

如果你要在工作目录中留着该文件,可以使用 git rm --cached

如我们删除 hello.php文件:

git rm hello.php 

  当前的工作目录和 本地的缓存区都不会有hello.php文件了。

git rm And git rm --cached And git reset HEAD

标签:本地   文件   str   eset   目录   硬盘   file   --   php文件   

原文地址:http://www.cnblogs.com/bing-yu12/p/6942342.html

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