gpt4 book ai didi

git - 无法删除无意中创建的远程分支

转载 作者:IT王子 更新时间:2023-10-29 01:02:18 25 4
gpt4 key购买 nike

$ git branch -a
* SocialAct
master
remotes/origin/HEAD -> origin/master
remotes/origin/SocialAct
remotes/origin/social

我想删除远程分支“remotes/origin/social”,并应用了以下命令:

$ git branch -d -r origin/social
Deleted remote branch origin/social (was 26f6f61).

但我不知道如何远程带来这些更改,以便从源中删除分支并且每个人都可以看到更改。我尝试了 git push 但它不起作用

任何帮助。

最佳答案

我有这个错误(来自上面):

Thanks. Actually I noticed this solution and tried earlier. But this gives following error... $ git push origin :heads/socail Enter passphrase for key '/h/.ssh/id_rsa': error: unable to push to unqualified destination: heads/socail 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@xxxxxx.git' – Himel May 24 '10 at 9:37

它似乎对我是否真的远程删除了它感到困惑。我像这样解决它:

git push origin HEAD:branch_to_delete

git push origin :branch_to_delete

这对我有用。使用:git 版本 1.7.3.1.msysgit.0

关于git - 无法删除无意中创建的远程分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2895906/

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