Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Git:内部错误:refs/remotes/origin/master不是有效的打包引用_Windows_Git - Fatal编程技术网

Windows Git:内部错误:refs/remotes/origin/master不是有效的打包引用

Windows Git:内部错误:refs/remotes/origin/master不是有效的打包引用,windows,git,Windows,Git,我试图在Windows网络驱动器上克隆git存储库,但该过程失败。它首先抛出一个内部错误:refs/remotes/origin/master不是有效的压缩引用,然后反复指出它未能取消索引文件的链接 x:\code\source> git clone x:\code\repos\project.git Cloning into 'project'... done. error: internal error: refs/remotes/origin/master is not a vali

我试图在Windows网络驱动器上克隆git存储库,但该过程失败。它首先抛出一个
内部错误:refs/remotes/origin/master不是有效的压缩引用
,然后反复指出它未能取消索引文件的链接

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)
我可以从网络驱动器上的裸repo克隆到本地驱动器,而无需发出任何问题,但无法克隆到网络驱动器。

使用标准Windows命令提示符克隆到映射的网络驱动器时,需要在from路径前面加上
文件://

例如:

或者,如果有空间

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

对于未来试图使用GitExtensions并遇到此错误的读者:David C的答案也适用于我们的目的,您可以在“Repo to clone”位置名称之前键入
文件://

当要克隆的Repo和目标目录都位于本地网络驱动器上时,会出现此错误


这正是我的问题所在!旧版本的Git工作时不需要
文件://
前缀。如何通过GUI解决此错误?我在“git扩展”中看到过这个,它不接受URI路径。
cd y:\code\source
git clone file://x:\code\repos\project.git project