代码之家  ›  专栏  ›  技术社区  ›  Interlated

Git显示状态干净,但checkout抱怨覆盖了未跟踪的文件

  •  4
  • Interlated  · 技术社区  · 7 年前

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

    问题是什么?

    1 回复  |  直到 7 年前
        1
  •  4
  •   Interlated    7 年前

    看看这个问题。文件列表:

    > ls
    imageButton.png
    imagebutton.png
    

    检查git是否设置为区分大小写

    > vi .git/config
    ignorecase = false
    

    这台机器区分大小写。换衣服的机器一定也坏了。

    > git log
    removeformat.png - renamed from removeFormat.png. 
    

    > git status
    
    Untracked files:
    (use "git add <file>..." to include in what will be committed)
    
    blockQuote.png
    bulletedList.png
    

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

    我可以毫无问题地结帐到另一家分行。