2017-09-05 101 views
2

首先:Git的显示状态干净,但结账抱怨覆盖未跟踪文件

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签出失败。

什么问题?

+0

.gitignore忽略了PNG文件?如果你'mv blockQuote.png/tmp /'或存储它,结账是否成功? –

回答

3

该问题是由于文件系统的区分大小写。

看问题。文件清单:

> 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的清洁也将按预期

git clean -f . 
Removing blockQuote.png 
Removing bulletedList.png 

我可以检出其他分支没有问题。

相关问题