V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
tedd
V2EX  ›  git

git status 里面有几个已删除文件的记录,怎么能将它们从 git status 里面清除呢

  •  
  •   tedd · 2014-07-27 21:44:27 +08:00 · 4342 次点击
    这是一个创建于 3562 天前的主题,其中的信息可能已经有所发展或是发生改变。
    之前删除了几个vim的缓存文件,现在通过git status可以看到这几个文件名的记录,每次git add . -> git push后这些记录还在,请问怎么才能将它们从git status中去掉呢
    3 条回复    2014-07-28 09:09:13 +08:00
    virusdefender
        1
    virusdefender  
       2014-07-27 21:47:53 +08:00   ❤️ 1
    git rm ***
    aa65535
        2
    aa65535  
       2014-07-27 22:13:04 +08:00   ❤️ 1
    使用 git rm 再删一次, git add . 后 git commit 提交
    直接 git commit -am "delete files" 提交
    使用 git add -all , 然后 git commit 提交

    以上三种都可以。
    yangg
        3
    yangg  
       2014-07-28 09:09:13 +08:00
    lz 要的是 `git rm --cached path/to/filename` ?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2844 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 15:11 · PVG 23:11 · LAX 08:11 · JFK 11:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.