首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >git fetch --显示错误的标记:无法锁定ref 'refs/remotes/origin/pr/

git fetch --显示错误的标记:无法锁定ref 'refs/remotes/origin/pr/
EN

Stack Overflow用户
提问于 2019-05-03 19:09:28
回答 1查看 945关注 0票数 2

我正在尝试执行下面的git命令-

git fetch --tags --progress https://github.com/<org>/<repo-name>.git +refs/pull/*:refs/remotes/origin/pr/*

并且不断地收到错误:

代码语言:javascript
复制
error: cannot lock ref 'refs/remotes/origin/pr/1/head': 'refs/remotes/origin/pr' exists; cannot create 'refs/remotes/origin/pr/1/head'
From https://github.com/<org>/<repo-name>
 ! [new ref]             refs/pull/1/head    -> origin/pr/1/head  (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/pr/10/head': 'refs/remotes/origin/pr' exists; cannot create 'refs/remotes/origin/pr/10/head'
 ! [new ref]             refs/pull/10/head   -> origin/pr/10/head  (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/pr/100/head': 'refs/remotes/origin/pr' exists; cannot create 'refs/remotes/origin/pr/100/head'
 ! [new ref]             refs/pull/100/head  -> origin/pr/100/head  (unable to update local ref)

任何关于如何解决的提示都将不胜感激。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-03 19:21:12

看起来以前有一个名为pr的分支,而新分支位于具有该名称的文件夹中,因此它是冲突的。

尝试git remote prune origin,这将删除旧分支的本地跟踪副本,然后再次尝试您的命令。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55968601

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档