最佳答案
我创建了一个分支 notmaster
来提交以及推送一些更改。当我完成这个分支时,我将更改合并回 master
,将它们推出,然后删除本地 notmaster
。
$ git branch -a
* master
remotes/origin/master
remotes/origin/notmaster
有办法删除远程 notmaster
吗?
对于 来自 Ionut 的解决方案,再清晰一点:
通常的方法对我来说失败了:
$ git push origin :notmaster
error: dst refspec notmaster matches more than one.
那是因为我有一个标签和分行的名字一样。这对我来说是个糟糕的选择,导致了这种模棱两可。所以在这种情况下:
$ git push origin :refs/heads/notmaster