When deleting remote git branch “error: unable to push to unqualified destination”

后端 未结 9 1893
南旧
南旧 2020-12-12 10:42

I\'m trying to delete a remote git branch with

git push origin :my_remote_branch

and getting:

error: unable to push to unq         


        
相关标签:
9条回答
  • 2020-12-12 11:25

    Had this same issue, I manually edited my ./.git/config file to include:

    [branch "branchName"]
    remote = origin
    merge = refs/heads/branchName
    

    Which resulted into: error: src refspec branchName matches more than one. This I fixed by running $git tag -d branchName. After which I was able to push the new branch to upstream.

    0 讨论(0)
  • 2020-12-12 11:32

    For me the problem was, that this was my default branch on github. I changed default branch, then delete operation was succeeded.

    Hope it helps to someone

    0 讨论(0)
  • 2020-12-12 11:33

    The fact that refs/remotes/origin/my_remote_branch exists in your local repository does not imply refs/heads/my_remote_branch exists in the origin remote repository.

    Do git fetch -p origin to make refs/remotes/origin/my_remote_branch go away if it's already deleted in origin. The -p option tells fetch to delete any tracking branches that no longer exist in the corresponding remotes; by default they are kept around.

    0 讨论(0)
提交回复
热议问题