वर्तमान में स्वीकार जवाब मुझे मदद नहीं की क्योंकि मैं नष्ट करने के लिए दूरदराज के रेपो पर एक रेफरी नहीं था - यह अपने स्थानीय पर विशुद्ध रूप से हो गया था! तो अगर आप उस स्थिति में हैं, तो यहां क्या करना है:
यह वह समस्या है जिसका मैं सामना कर रहा था:
$ 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