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

2014-07-27 21:44:27 +08:00
 tedd
之前删除了几个vim的缓存文件,现在通过git status可以看到这几个文件名的记录,每次git add . -> git push后这些记录还在,请问怎么才能将它们从git status中去掉呢
4350 次点击
所在节点    git
3 条回复
virusdefender
2014-07-27 21:47:53 +08:00
git rm ***
aa65535
2014-07-27 22:13:04 +08:00
使用 git rm 再删一次, git add . 后 git commit 提交
直接 git commit -am "delete files" 提交
使用 git add -all , 然后 git commit 提交

以上三种都可以。
yangg
2014-07-28 09:09:13 +08:00
lz 要的是 `git rm --cached path/to/filename` ?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/124763

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX