【发布时间】:2021-12-31 09:05:20
【问题描述】:
在 Windows 10 中克隆大型项目时出现以下错误/警告。
....
error: unable to create symlink Codes/MyProject/Pods/Headers/Public/nanopb/pb_common.h: No such file or directory
error: unable to create symlink Codes/MyProject/Pods/Headers/Public/nanopb/pb_decode.h: No such file or directory
error: unable to create symlink Codes/MyProject/Pods/Headers/Public/nanopb/pb_encode.h: No such file or directory
Updating files: 100% (9536/9536), done.
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
为什么会出现警告以及如何解决?
但是,我尝试按照 gits 的建议从下载的 repo 根目录运行以下命令,
git restore --source=HEAD :/
但我又遇到了类似的错误,
....
error: unable to create symlink Codes/MyProject/Pods/Headers/Public/nanopb/pb_common.h: No such file or directory
error: unable to create symlink Codes/MyProject/Pods/Headers/Public/nanopb/pb_decode.h: No such file or directory
error: unable to create symlink Codes/MyProject/Pods/Headers/Public/nanopb/pb_encode.h: No such file or directory
【问题讨论】:
-
可能是区分大小写的文件系统的问题
-
@knittl 不知道。如何为 windows git bash 修复它?
-
你不能真正修复这个在 Windows。 (使用 Linux 或 WSL 可以更轻松地处理它。)但是,如果您禁用
core.symlinks,您也许可以解决它。见your own question here。 -
就我而言,问题是文件名太长。它对我有用.. git config --global core.longpaths true
-
@torek 禁用
core.symlinks无效。我认为问题是不同的。
标签: git github version-control git-clone git-checkout