错误:无法锁定ref ..'refs / tags'存在;无法创建'refs / tags / [英] error: cannot lock ref.. 'refs/tags' exists; cannot create 'refs/tags/

查看:1601
本文介绍了错误:无法锁定ref ..'refs / tags'存在;无法创建'refs / tags /的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图从github提取更改时,我遇到了一个奇怪的无法锁定ref错误。我已经尝试过git gc,并且四处寻找类似的错误,但是找不到解决方案。

I'm getting a strange "cannot lock ref" error when trying to pull changes from github. I've tried git gc, and looked around for similar errors but can't find a solution.

> git pull
error: cannot lock ref 'refs/tags/v2.8': 'refs/tags' exists; cannot create 'refs/tags/v2.8'
From github.com:k3it/qsorder
 ! [new tag]         v2.8       -> v2.8  (unable to update local ref)
error: cannot lock ref 'refs/tags/v2.9': 'refs/tags' exists; cannot create 'refs/tags/v2.9'
 ! [new tag]         v2.9       -> v2.9  (unable to update local ref)


推荐答案

您Git抱怨存在名为 refs / tags 的引用(而不是目录)。目前还不清楚创建是什么,但是看看 git rev-parse refs / tags 是否会生成一个哈希ID。如果是这样,那个引用需要消失:

Your Git is complaining that a reference (rather than a directory) named refs/tags exists. It's not clear what would create that, but see if git rev-parse refs/tags produces a hash ID. If so, that reference needs to go away:

git update-ref -d refs/tags

之后 git fetch 应该可以工作。

如果 git rev-parse refs / tags 失败(它应该 - refs / tags 本身不应该是一个有效的名称),那么这是不是问题,并不清楚实际问题是什么。

If git rev-parse refs/tags fails (which it should—refs/tags itself should not be a valid name) then this is not the problem and it's not clear what the actual problem is.

这篇关于错误:无法锁定ref ..'refs / tags'存在;无法创建'refs / tags /的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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