I\'m trying to delete a remote git branch with
git push origin :my_remote_branch
and getting:
error: unable to push to unq
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.
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
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.