git reset --hard HEAD将未跟踪的文件留在后面 [英] git reset --hard HEAD leaves untracked files behind
本文介绍了git reset --hard HEAD将未跟踪的文件留在后面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行 git reset --hard HEAD
时,它应该重置为您所拉取内容的原始版本,据我了解。不幸的是,它留下了文件,因为 git status
显示了一大串未跟踪文件。
git clean -f -d
来清除工作副本中未跟踪的文件和目录。 When I run git reset --hard HEAD
, it's supposed to reset to a pristine version of what you pulled, as I understand it. Unfortunately, it leaves files lying around, as a git status
shows a big list of untracked files.
How do you tell git "Just bring it back to EXACTLY what was in the last pull, nothing more, nothing less"?
解决方案
You have to use git clean -f -d
to get rid of untracked files and directories in your working copy.
这篇关于git reset --hard HEAD将未跟踪的文件留在后面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文