问题描述
I'm trying to do a git pull and get the error message:
我试图做一个 git pull 并得到错误消息: :以下未跟踪的工作树文件将被合并覆盖:
< myFileName>
请在合并前移动或移除它们。
error: The following untracked working tree files would be overwritten by merge:<myFileName>Please move or remove them before you can merge.
因此,我尝试使用 git rm --cache 会导致错误:
So, I try to remove the file using the command git rm --cache which results in the error:
fatal: pathspec
<myFileName>
did not match any files
此时我卡住了。除非我删除文件,否则我无法拉动。但是,它告诉我我无法删除该文件。
At this point I'm stuck. I can't pull until I remove the file. But, it tells me I can't remove the file.
我可以做些什么来解决这个问题?
What can I do to fix this?
推荐答案
未拉伸的文件在拉的方式。你不能用 git rm --cached
删除它们,因为它们没有被跟踪。他们没有出现在索引中。你需要用普通的老旧的 rm
You have untracked files in the way of the pull. You can't remove them with git rm --cached
because they are untracked. They don't appear in the index. You need to remove them with plain old rm
这篇关于不能做一个混帐拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!