Use git rm foo to stage the file for deletion. (This will also delete the file from the file system, if it hadn't been previously deleted. It can, of course, be restored from git, since it was previously checked it.)

To stage the file for deletion without deleting it from the file system, use git rm --cached foo

from: http://stackoverflow.com/questions/12373733/staging-deleted-files

git Staging Deleted files的更多相关文章

  1. Git tricks: Unstaging files

    NOTE: Following content is directly reprinted from http://andrewberls.com/blog/post/git-tricks-unsta ...

  2. Eclipse中java文件边的黄色数据库标志变成了蓝色小勾,导致文件修改后无法显示在Git staging窗口中,修改无法提交,怎么解决?

    出现这个问题的原因是误点击了右键点文件->Team->Advanced->Assume Unchanged, 导致结果是文件修改了无法显示在Git staging窗口中,自然无法提交 ...

  3. How do I commit all deleted files in Git?

    Try this: $ git add -u This tells git to automatically stage tracked files -- including deleting the ...

  4. git add Untracked files

    git add *  将目录里的所有文件提交到暂存区后 git status 查看状态  所有文件都是绿色的表示本地的文件和暂存区的文件是一样的 然后在本地修改一个文件 然后新建一个文件 在使用git ...

  5. [ImportNew] Perforce - Restoring Mistakenly Deleted Files in Workspace

    Shit happens when you accidentally delete some files in your workspace and you have no ideas which o ...

  6. git中Untracked files如何清除

    $ git status # On branch test # Untracked files: # (use "git add <file>..." to inclu ...

  7. git 提交ignore files

    1,首先在命令行创建.gitignore文件 $ touch .gitignore 2,在文件.gitignore 加入要忽略的文件入 $ echo *.class > .gitignore 3 ...

  8. git submodule 使用

    这个是备忘录,原网页: https://medium.com/@porteneuve/mastering-git-submodules-34c65e940407 http://cncc.bingj.c ...

  9. git的几十个基本面

    1.下载git?git-scm.com 2.获取帮助git helpgit help config 3.什么是Git?版本控制系统,Version Control System, VCS.它允许我们提 ...

随机推荐

  1. EF4.4 升级EF6.0问题总结

    如出现下面代码错误,基本可能确定EF数据库配置错误 在 System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeReso ...

  2. [Linux] ubuntu 格式化u盘

    $sudo fdisks -l 基本功,格式化命令,以格式化 /dev/sdb4 分区为例:$ sudo umount /dev/sdb4    # 必须先卸载该分区 # 格式化为 FAT 分区$ s ...

  3. [转载]DIY树莓派之随身工具箱

    摆弄树莓派有一年多了,在这里把经验分享给大家,少走弯路. 先放图两张. 搭建目的: wifi信号中转站\网站服务器\IC卡渗透测试\中间人\otr… 基于树莓派3 系统为Kali Linux 2017 ...

  4. Drupal 7.31 SQL Injection Exp

    #-*- coding:utf-8 -*- import urllib2,sys import hashlib   # Calculate a non-truncated Drupal 7 compa ...

  5. map-reduce任务的执行流程

    (1).客户端提交一个mr的jar包给JobClient(提交方式:hadoop jar ...) (2).JobClient通过RPC和JobTracker进行通信,返回一个存放jar包的地址(HD ...

  6. Selenium用法示例

    收录待用,修改转载已取得腾讯云授权 前言 在上一节我们学习了PhantomJS 的基本用法,归根结底它是一个没有界面的浏览器,而且运行的是 JavaScript 脚本,然而这就能写爬虫了吗?这又和Py ...

  7. 开源框架Quartz动态加入、改动和删除定时任务 (二)

    貌似每次回过头去看之前写的一些东西,总感觉不是非常完美~~虽说不做完美人.但也要做完美事!这次主要是针对Quartz的动态维护和Spring集成.简单粗暴一点,直接上代码,有什么不了解留言交流 先来一 ...

  8. [Angular] Angular Custom Change Detection with ChangeDetectorRef

    Each component has its own ChangeDetectorRef, and we can inject ChangeDetectorRef into constructor: ...

  9. iOS wkwebview和 uiwebview 内容图片自适应大小

    - (void)webViewDidFinishLoad:(UIWebView *)webView { // 2.都有效果 NSString *js=@"var script = docum ...

  10. Rational Performance Tester(RPTv8.6) 在launch Schedule 时一直卡在 29%

    solution:Rational Performance Tester(RPTv8.6) 在launch Schedule 时一直卡在 29% 打开Task Manager(Windows serv ...