I am just going to give a quick example on how to this.
$ git push origin :REMOTE_BRANCH_NAME
For a concrete example of this in action
$ git branch -r > origin/develop > origin/master $ git push origin :develop > To /home/aaron/development/atestrepo.git - [deleted] develop $ git branch -r > origin/master
So, why does this work, and why is the syntax so odd?
Well if we look at the push command in more detail it starts to make some sense.
If we want to push a local branch to a remote, we would do it like this
$ git push origin mybranch
Here, origin is the remote, and mybranch the local branch to push up. The result of this command is we now have a remote branch origin/mybranch. But what if we wanted to call the remote branch something else? We would do that like this:
$ git push origin mybranch:adiffnamefortheremotebranch
This syntax effectively translates to push to a branch adiffnameforremotebranch at remote origin the contents of mybranch. Now, can you see where this is going with respect to our delete? Deleting a remote branch with just a leading : (and no local branch name) is basically saying push nothing into remote branch called someremotebranch. Git takes this to mean delete the remote branch.
$ git push origin :someremotebranch
I find thinking of it in these terms, makes it easier to remember the syntax.
It's also worth reading the Pro Git Chapter on remotes which also covers (although, sadly, too briefly) deleting remote branches.