我正在尝试在Windows网络驱动器上克隆git存储库,但该过程失败。它首先抛出internal error: refs/remotes/origin/master is not a valid packed reference
,然后反复声明它无法取消链接索引文件。
x:\code\source> git clone x:\code\repos\project.git
Cloning into 'project'...
done.
error: internal error: refs/remotes/origin/master is not a valid packed reference!
fatal: update_ref failed for ref 'HEAD': cannot update the ref 'HEAD':
Trying to write ref refs/heads/master with nonexistent object d34950c3faee46d8a7f3b8e7950b04fcc5da9d1c
Unlink of file 'project/.git/objects/pack/pack-....idx' failed. Should I try again? (y/n)
我可以从网络驱动器上的裸仓库中无问题地克隆到本地驱动器,但无法克隆到网络驱动器。
答案 0 :(得分:17)
使用标准Windows命令提示符将克隆到映射的网络驱动器时,需要在 路径前加上file://
。
如,
git clone file://x:\code\repos\project.git
或者,如果有空格,
git clone "file://x:\my code\repos\project.git"
但是,在指定目标时,您不能这样做。
** DOESN'T WORK **
git clone file://x:\code\repos\project.git file://y:\code\source\project
相反,
cd y:\code\source
git clone file://x:\code\repos\project.git project
答案 1 :(得分:0)