Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - Cannot delete remote branch

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

So I tried to remove it from origin:

$ 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 got wwhen pushing:

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

So I removed the remote tag:

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

Still no go:

$ git branch -rD origin/0.2
 * [new branch]      0.2        -> origin/0.2
  1. Is it a git bug?
  2. Did I do something wrong apart from having a tag and branch name equals?
  3. How to remove this remote branch?
like image 518
shkschneider Avatar asked Apr 25 '12 19:04

shkschneider


1 Answers

This worked for me:

$ git push --delete origin refs/heads/0.2
like image 180
JJD Avatar answered Sep 29 '22 23:09

JJD