【问题标题】:Git clone displaying errors and marking files as deleted in Windows 10Git 克隆在 Windows 10 中显示错误并将文件标记为已删除
【发布时间】:2016-08-18 01:58:50
【问题描述】:

尝试使用 git 克隆存储库时出现以下错误:

Fatal: Unable to checkout working tree
warning: Clone succeeded, but failed checkout.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

此外,以下消息出现在多个文件中:'error: Unable to create file'

http://i.imgur.com/vz13IMe.png

通过使用'git status'命令,我看到很多文件被标记为已删除[实际上文件仍然存在]

http://i.imgur.com/KoizHw0.png

我按照第一个错误的要求使用了git checkout -f HEAD命令,但结果如下

http://i.imgur.com/miFEgMr.png

【问题讨论】:

    标签: windows git github windows-10 git-bash


    【解决方案1】:

    您的文件包含 Windows 下不允许的特殊字符。 这就是您无法签出文件名的原因。

    修复它的唯一方法是在非 Windows 机器上克隆存储库并重命名它们。

    文件名中禁止使用以下字符(Win)

    The following reserved characters:

    < (less than)  
    > (greater than)  
    : (colon)  
    " (double quote)  
    / (forward slash)  
    \ (backslash)  
    | (vertical bar or pipe)  
    ? (question mark)  
    &#42; (asterisk)  
    

    【讨论】:

      【解决方案2】:

      显然,您存储库中的文件的名称中包含问号 (?)。问号是一个特殊符号,不允许在 Windows 上的文件名中使用。

      Afaik,您的问题没有解决方案(除了使用不同的操作系统)。

      但是,为什么文件名包含问号?它们看起来像是被网络蜘蛛(在不同的操作系统上)从网上报废的。问号和它后面的片段不应该是文件名的一部分。

      【讨论】:

      • 谢谢!我做到了,一切正常!实际上文件已经被抓取器下载了
      猜你喜欢
      • 2011-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-30
      • 2022-08-20
      • 1970-01-01
      • 2023-03-10
      • 2011-06-29
      相关资源
      最近更新 更多