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. [Git] Git 的origin和master分析

    转载: http://lishicongli.blog.163.com/blog/static/1468259020132125247302/ 首先要明确一点,对git的操作是围绕3个大的步骤来展开的 ...

  2. PostgreSQL配置文件--复制

    4 复制 REPLICATION 4.1 Sending Server(s) 4.1.1 max_wal_senders 数字型 默认: max_wal_senders = 10 , 为0表示启用流复 ...

  3. 部署Redis 成windows服务

    Redis是可以安装成windows服务的,开机自启动,命令如下: redis-server --service-install redis.windows.conf 安装完之后,就可看到Redis已 ...

  4. [Functional Programming] Pull Many Random Numbers in a Single State ADT Transaction

    We have the ability to select a single random card from a pile of twelve cards, but we would like to ...

  5. SRS Audio Sandbox没有声音怎么办

    首先介绍下这款软件呵: SRS Audio Sandbox是一款个人电脑终极音频增强软件.该软件可以提供令人叹为观止的环绕音效,重低音效果并且非常清晰,甚至可以用於桌面扬声器.可以作用於个人电脑上的所 ...

  6. Chrome 跨域调试

    1.关闭chrome浏览器(全部) 我们可以通过使用chrome命令行启动参数来改变chrome浏览器的设置,具体的启动参数说明参考这篇介绍.https://code.google.com/p/xia ...

  7. GCM与C2DM相比有什么不同

    eoe介绍:http://wiki.eoe.cn/page/Migration.html 官方地址:http://developer.android.com/google/gcm/c2dm.html

  8. 详解Android首选项框架的使用

    首选项这个名词对于熟悉Android的朋友们一定不会感到陌生,它经常用来设置软件的运行参数. Android提供了一种健壮并且灵活的框架来处理首选项.它提供了简单的API来隐藏首选项的读取和持久化,并 ...

  9. android 完美的tabhost 切换多activity布局

    TabHost在很多应用都会使用到,有时候在TabHost添加的Tab中设置view不能满足需求,因为在view中添加如PreferenceActivity相当困难. 之前在一个应用中需要实现使用Ta ...

  10. jquery淡入淡出无延迟代码

    <!DOCTYPE html> <html> <head> <script src="jquery.js"></script& ...