2017-09-05 154 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 

我可以檢出其他分支沒有問題。

相關問題