Git:内部错误:refs / remotes / origin / master不是有效的打包引用 [英] Git: Internal error: refs/remotes/origin/master is not a valid packed reference

查看:6976
本文介绍了Git:内部错误:refs / remotes / origin / master不是有效的打包引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am attempting to clone a git repository on a Windows network drive, but the process fails. It first throws a internal error: refs/remotes/origin/master is not a valid packed reference, and then repeatedly relates that it failed to unlink an index file.

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)

我可以从裸仓库克隆到本地驱动器网络驱动器,但无法克隆到网络驱动器。

I am able to clone without issue to a local drive from a bare repo on the network drive, but am unable to clone to a network drive.

推荐答案

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

When cloning to a mapped network drive using a standard Windows command prompt, you need to preface the from path with file://.

例如,

E.g.,

git clone file://x:\code\repos\project.git

或者,如果有空格,

or, if there are spaces,

git clone "file://x:\my code\repos\project.git"

然而,当指定目标时,您不能这样做。

You cannot, however, do the same when specifying the target.

** DOESN'T WORK **
git clone file://x:\code\repos\project.git file://y:\code\source\project

相反,

Instead,

cd y:\code\source
git clone file://x:\code\repos\project.git project

这篇关于Git:内部错误:refs / remotes / origin / master不是有效的打包引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆