【发布时间】:2011-11-27 03:29:35
【问题描述】:
可能重复:
How do you remove untracked files from your git working copy?
是否可以告诉 git 删除未跟踪的文件?主要是类似于重置的东西?
示例:
git checkout -- index.php <-- revert my file
git checkout -- master <-- this would revert the entire repo back to the last commit on master, removing (deleting) any and all untracked files as well as reverting committed ones.
我知道这在 shell 上是微不足道的。但我想知道这是否可以在 Git 中完成?
【问题讨论】:
-
git checkout -- master将不会签出分支master,但会在当前提交时签出名为master的 文件(@ 987654326@)
标签: git version-control