Git 显示状态干净,但结帐抱怨覆盖未跟踪的文件
Git shows status clean, but checkout complains about overwriting untracked files
首先:
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 结帐失败。
问题是什么?
此问题是由于文件系统区分大小写引起的。
正在看问题。文件列表:
> ls
imageButton.png
imagebutton.png
检查 git 是否设置为区分大小写
> vi .git/config
ignorecase = false
本机区分大小写。进行更改的机器一定也是。
> git log
removeformat.png - renamed from removeFormat.png.
由于我更改了 ignorecase,git 状态现在显示更改。
> 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 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 结帐失败。
问题是什么?
此问题是由于文件系统区分大小写引起的。
正在看问题。文件列表:
> ls
imageButton.png
imagebutton.png
检查 git 是否设置为区分大小写
> vi .git/config
ignorecase = false
本机区分大小写。进行更改的机器一定也是。
> git log
removeformat.png - renamed from removeFormat.png.
由于我更改了 ignorecase,git 状态现在显示更改。
> 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
我可以毫无问题地检查其他分支。