我正在尝试执行下面的git命令-
git fetch --tags --progress https://github.com/<org>/<repo-name>.git +refs/pull/*:refs/remotes/origin/pr/*
并且不断地收到错误:
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)任何关于如何解决的提示都将不胜感激。
发布于 2019-05-03 19:21:12
看起来以前有一个名为pr的分支,而新分支位于具有该名称的文件夹中,因此它是冲突的。
尝试git remote prune origin,这将删除旧分支的本地跟踪副本,然后再次尝试您的命令。
https://stackoverflow.com/questions/55968601
复制相似问题