偶然地,已经创建了分支remotes/upstream/upstream/develop
。上游受GitHub控制。标准删除命令失败:
$ git fetch --all
$ git branch -a
* develop
master
remotes/origin/HEAD -> origin/develop
remotes/origin/develop
remotes/origin/master
remotes/upstream/develop
remotes/upstream/master
remotes/upstream/upstream/develop
$ git push upstream --delete upstream/develop
error: unable to delete 'upstream/develop': remote ref does not exist
error: failed to push some refs to 'git@github.com:...'
.git/config
具有标准节
[remote "upstream"]
url = git@github.com:...
fetch = +refs/heads/*:refs/remotes/upstream/*
答案 0 :(得分:0)
显然,意外创建的分支从未被推送到上游服务器,或者未被接受;无论如何,git branch fetch --all
并未将其传播到其他客户端。因此可以使用
$ git branch -r -D upstream/upstream/develop
Deleted remote-tracking branch upstream/upstream/develop (was e49bbca1).