无法删除无意中创建的远程分支 [英] Cannot delete a remote branch created unintentionally

查看:560
本文介绍了无法删除无意中创建的远程分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

I want to delete the remote branch "remotes/origin/social", and applied folloing command:

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

但我不知道如何远程引入这些更改,以便将分支从源中删除可以看到变化。我尝试了git push,但那不起作用

But I have no idea how to bring these changes remotely so that the branches are deleted from origin and everyone can see the changes. I tried git push but that does not work

任何帮助。

Any help.

推荐答案

我有这个错误(从上面):

I had this error (from above):


谢谢。其实我注意到这个
解决方案,并尝试更早。但是,这
给出以下错误... $ git push
origin:heads / socail为密钥'/h/.ssh/id_rsa'输入密码
:错误:
无法推送到不合格的
目的地:heads / socail
目的地refspec既不与远程的
现有ref匹配,也不会与refs /开始
,并且我们无法猜测$ b $基于源文件的ba前缀。
错误:未能推动一些裁判
'git@xxxxxx.git' - Himel 10年5月24日在
9:37

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

似乎对我是否真的已经远程删除它感到困惑。我的工作如下所示:

It seemed to have gotten confused about whether or not I had actually deleted it remotely. I worked around it like so:

git push origin HEAD:branch_to_delete

git push origin :branch_to_delete

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

这篇关于无法删除无意中创建的远程分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆