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. Tomcat环境下配置数据源

    两种方式,图形化和字符型配置,图形化需要部署一个应用,字符型配置如下: 需要文件 mysql-connector-java-5.1.16-bin.jar Oracle需要classes12.jar文件 ...

  2. python获取linux本机IP

    #!/usr/bin/env python #encoding: utf-8 #description: get local ip address import os import socket, f ...

  3. JavaScriptCore全面解析 (上篇)

    收录待用,修改转载已取得腾讯云授权 作者 | 殷源 编辑 | 迷鹿 殷源,专注移动客户端开发,微软Imagine Cup中国区特等奖获得者,现就职于腾讯. JavaScript越来越多地出现在我们客户 ...

  4. vue2组件之异步组件...resolve

    看开源项目的时候看到这样的用法: 发现与之前定义组件的方式不一样,这个resolve又是什么? 原来这个是vue的异步组件实现,可以看这里:<异步组件> 异步组件的需求: 在大型应用中,我 ...

  5. linux下javadoc生成文件出现中文乱码

    javadoc命令的正确使用姿势 javadoc -d apidoc -windowtitle Testing -doctitle 'The API of javadoc' -header 'My c ...

  6. Vue 进入/离开动画

    1.示例代码 (注:写到vue单文件中了) <template> <div> <button v-on:click="show = !show"> ...

  7. Vue 组件开发demo

    1.代码地址 github:https://github.com/MengFangui/VueComponentDemo- 2.关键代码 (1)main.js //引入vue import Vue f ...

  8. GIT基本概念和用法总结【转】

    在日常使用GIT过程中,经常会出错,比如无意间丢失了未提交的数据,回退版本时丢失了工作目录,等等.经过思考发现,所有这些错误都是因为对GIT中一些基本的概念模糊而导致,因为对一些基本概念不清晰,导致对 ...

  9. 网站相关技术探究keepalive_timeout(转)

    网站相关技术探究keepalive设多少: /proc/$PID/fd/$number  0:标准输入 1:标准输出 2:标准错误   Test: [root@KTQT ~]# ll /proc/12 ...

  10. 利用pandas进行数据分析之ndarray结构

    Numpy的重要特点就是其N维数组对象, 1.ndarray每个元素是相同的,每个数组都有一个两个对象: .shape:用于表示维度大小的元组 .dtype:用户表示数组类型的对象 2.创建数组 ar ...