在我的扫描中出现奇怪的问题。没有什么可添加的,但它不会让我切换或添加建议添加的文件。由于已添加文件而无法切换分支
git status
# On branch oop
nothing to commit (working directory clean)
git checkout LIVE
error: The following untracked working tree files would be overwritten by checkout:
folder/file.js
folder/file2.js
Please move or remove them before you can switch branches.
Aborting
即使在做了git add folder/file.js;git add folder/file2.js
之后,也发生了相同的结果。
任何人有任何想法发生了什么?没有的.gitignore文件...
奇怪的是,之前,我不能添加这些文件,所以我不得不重新命名,添加,重命名他们,让他们在回购(如this answer建议。
难道这个文件夹曾经是它自己的repo吗?我删除了这个文件夹中的所有隐藏文件夹(如.git)。
它们很可能是您当前分支的'.gitignore'的一部分,但在LIVE分支上不会被忽略。 – 2013-02-10 22:18:37
我检查了repo文件夹中的.gitignore文件,以及我的主文件夹,它们都是空的。 – 2013-02-10 22:19:35
您可以使用'git status --ignored'来包含忽略的文件。如果他们出现在那里,他们会被忽略*在某处*。 – 2013-02-10 22:22:49