views:

172

answers:

2
$ git branch -a
* SocialAct
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/SocialAct
  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).

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.

A: 

Deleting remote branches is described in detail over here.

Noufal Ibrahim
+2  A: 

git push origin :social
But you need to delete locally as well, before or after.

Arkaitz Jimenez
Thanks. Actually I noticed this solution and tried earlier. But this gives following error...$ git push origin :heads/socailEnter passphrase for key '/h/.ssh/id_rsa':error: unable to push to unqualified destination: heads/socailThe destination refspec neither matches an existing ref on the remote norbegins with refs/, and we are unable to guess a prefix based on the source ref.error: failed to push some refs to '[email protected]'
Himel
I have deleted locally first, with command:$ git branch -d -r origin/socialor, did I do it wrong?
Himel
It doesn't matter that you delete locally or not, did u notice your last example has a typo socail/social ?
Arkaitz Jimenez
May I ask how would you do it, so it would go right?
Himel
Right, there was a typo, actually I wrote it here. but in actual console I applied it right.
Himel
Last time I had to do that it was exactly like that, in any case, the error message looks like the branch is not there any more, have you tried a to clone the repo and see if the branch is still there?
Arkaitz Jimenez
I shall try that. Good hint and thanks. Actually after applying the command, I have been verifying the end result in the repository URL (web) and the branch is still there. So I could not be sure that I could delete it.
Himel
At this point I'd check if the web interface is properly updated, or still showing cached content. Try to do a commit and see if the web reflects it.
Arkaitz Jimenez
If this isn't working, it's also possible that the remote repo is set up to not allow remote branch deletions. All the repos I administer are configured that way (because deleting a branch allows you to get around non-fast-forward update restrictions :-P ). In such a case the only way to delete the branch is to go to the remote repository and do it there.
ebneter