gpt4 book ai didi

git - 从 github 中删除错误的分支 remotes/upstream/upstream/develop]

转载 作者:太空狗 更新时间:2023-10-29 14:21:48 27 4
gpt4 key购买 nike

无意中,创建了一个分支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/*

最佳答案

显然,意外创建的分支从未被推送到上游服务器,或者未被接受;无论如何,git branch fetch --all 没有将它传播到其他客户端。所以它可以在本地删除

$ git branch -r -D upstream/upstream/develop
Deleted remote-tracking branch upstream/upstream/develop (was e49bbca1).

关于git - 从 github 中删除错误的分支 remotes/upstream/upstream/develop],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52445167/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com