git reset --hard HEAD将未跟踪的文件留在后面 [英] git reset --hard HEAD leaves untracked files behind

查看:196
本文介绍了git reset --hard HEAD将未跟踪的文件留在后面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行 git reset --hard HEAD 时,它应该重置为您所拉取内容的原始版本,据我了解。不幸的是,它留下了文件,因为 git status 显示了一大串未跟踪文件。

你告诉git只要把它回到最后拉什么,什么都没有,没有更少? 必须使用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆