Git clone 在 Windows 10 中显示错误并将文件标记为已删除
Git clone displaying errors and marking files as deleted in Windows 10
尝试使用 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
命令,但是结果如下
显然,您存储库中的文件名称中包含问号 (?
)。问号是一个特殊符号,不允许出现在 Windows.
上的文件名中
Afaik,您的问题没有解决方案(除了使用不同的 OS)。
但是,为什么文件名中包含问号?它们看起来像是被网络蜘蛛从网上抓取的(在不同的 OS 上)。问号及其后的片段不应作为文件名的一部分。
您的文件包含 windows 不允许的特殊字符。
这就是为什么您无法检出文件名的原因。
修复它的唯一方法是在非 windows 机器上克隆存储库并重命名它们。
文件名中禁止使用以下字符 (Win)
The following reserved characters:
< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)
尝试使用 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
命令,但是结果如下
显然,您存储库中的文件名称中包含问号 (?
)。问号是一个特殊符号,不允许出现在 Windows.
Afaik,您的问题没有解决方案(除了使用不同的 OS)。
但是,为什么文件名中包含问号?它们看起来像是被网络蜘蛛从网上抓取的(在不同的 OS 上)。问号及其后的片段不应作为文件名的一部分。
您的文件包含 windows 不允许的特殊字符。 这就是为什么您无法检出文件名的原因。
修复它的唯一方法是在非 windows 机器上克隆存储库并重命名它们。
文件名中禁止使用以下字符 (Win)
The following reserved characters:
< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)