我无法删除名为origin/featureBranch
的远程分支。我猜测这是因为分支名称以origin
开头,但我不确定。
$ git branch -r | grep featureBranch
origin/origin/featureBranch
$ git push origin :origin/featureBranch
error: unable to push to unqualified destination: origin/featureBranch
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'git@github.com:myCompany/my-repo.git'
更新
$ git push origin :featureBranch
会得到同样的错误。
注意
在远程分支中是 origin/origin/myFeature
,而本地分支是 origin/myFeature
。
我知道 origin
通常是什么意思,但在我的情况下 - 这是分支名称的一部分。
Github 没有看到这个分支。
请问是否有人可以向我解释这些背后发生了什么,并且如何删除这个分支?