Git - Unable to delete remote branch

I made a git branch inadvertently named "0.2", which is also a tag.

So I tried to remove it from the source:

$ git branch -rD origin/0.2 Deleted remote branch origin/0.2 

But then:

 $ git fetch origin * [new branch] 0.2 -> origin/0.2 

Here is the error I received by clicking:

 $ git push --force origin :0.2 error: dst refspec 0.2 matches more than one. 

So, I deleted the remote tag:

 $ git tag -d 0.2 $ git push origin :refs/tags/0.2 

Still no:

 $ git branch -rD origin/0.2 * [new branch] 0.2 -> origin/0.2 
  • Is this a git bug?
  • Did I do something wrong, except that the tag and branch name are equal?
  • How to delete a remote branch?
+7
source share
2 answers

Usually git push --force origin :0.2 is executed after the deletion (locally and remotely) the tag should do the correct deletion.

+2
source

This worked for me:

 $ git push --delete origin refs/heads/0.2 
+2
source

All Articles