현재 허용 대답은 내가 삭제 원격 REPO에 심판을 가지고 있지 않았기 때문에 나에게 도움이되지 않았다 - 내 지역에 순수했다! 따라서 이러한 상황에 처한 경우 수행 할 작업은 다음과 같습니다.
이것이 내가 직면 한 문제입니다.
$ git fetch origin
error: cannot lock ref 'refs/remotes/origin/fix/sub-branch':
'refs/remotes/origin/fix' exists; cannot create
'refs/remotes/origin/fix/sub-branch'
From <repo URL>
! [new branch] fix/sub-branch -> origin/fix/sub-branch
(unable to update local ref)
나는 받아 들여진 대답의 제안을 시도했지만 이것을 얻었습니다.
$ git push origin :fix
error: unable to delete 'fix': remote ref does not exist
error: failed to push some refs to <repo URL>
그래서 심판은 심지어 존재하지도 않았습니다. origin그것은 분명히 내 로컬 저장소 어딘가에 어딘가에 매달려있었습니다. 그래서 나는 다음 $ git remote show me을 생산했습니다.
Remote branches:
...
refs/remotes/origin/fix stale (use 'git remote prune' to remove)
...
그런 다음 솔루션을 명확하게 만들었습니다.
$ git remote prune origin
Pruning origin
URL: <redacted>
* [pruned] origin/fix
이것으로 문제가 사라졌습니다.
$ git fetch origin
remote: Counting objects: 5, done.
remote: Total 5 (delta 2), reused 2 (delta 2), pack-reused 3
Unpacking objects: 100% (5/5), done.
From <repo URL>
* [new branch] fix/sub-branch -> origin/fix/sub-branch