首先:
git status
结果很干净。
其次
git checkout fb/booking_interaction
error: The following untracked working tree files would be overwritten by checkout:
web/sites/all/modules/contrib/ckeditor/images/buttons/blockQuote.png
第三,尝试清除未跟踪的文件。在指定目录下:
git clean -f .
同样,没有更改,git checkout 失败。
问题是什么?
最佳答案
此问题是由于文件系统区分大小写引起的。
看问题。文件列表:
> ls
imageButton.png
imagebutton.png
检查git是否设置为区分大小写
> vi .git/config
ignorecase = false
native 区分大小写。进行更改的机器一定也是。
> git log
removeformat.png - renamed from removeFormat.png.
由于我更改了 ignorecase,git status 现在会显示更改。
> git status
Untracked files:
(use "git add <file>..." to include in what will be committed)
blockQuote.png
bulletedList.png
Git clean 也按预期工作
git clean -f .
Removing blockQuote.png
Removing bulletedList.png
我可以毫无问题地检查另一个分支。
关于Git 显示状态干净,但 checkout 提示覆盖未跟踪的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46046865/