码迷,mamicode.com
首页 > 其他好文 > 详细

Git CMD - rm: Remove files from the working tree and from the index

时间:2015-12-30 21:57:31      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:

命令格式

git rm [-f | --force] [-n] [-r] [--cached] [--ignore-unmatch] [--quiet] [--] <file>…?

 

命令参数

-f, --force

  强制删除。

-r

  递归删除目录及其内容。

-- cached

  从暂存区移除文件,不再跟踪文件,工作区的文件仍保留下来。

-q, --quit

  安静模式。

 

实例

a) 从工作区和暂存区将文件移除。

$ git rm testfile.txt

b) 从工作区和暂存区将目录移除。

$ git rm -rf src/

c) 从暂存区移除文件,不再跟踪文件,工作区的文件仍保留下来。

$ git rm --cached testfile.txt

 

Git CMD - rm: Remove files from the working tree and from the index

标签:

原文地址:http://www.cnblogs.com/huey/p/5089777.html

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