From help.github.com git push
can be used in the following way to delete a remote branch:
git push <REMOTENAME> :<BRANCHNAME>
(...) you're telling Git to push nothing into BRANCHNAME on REMOTENAME. Because of this,
git push
deletes the branch on the remote repository.
However from git-scm.com, this also deletes a remote branch:
git branch -d -r <REMOTENAME>/<BRANCHNAME>
Adding that:
The next fetch or pull will create [it] again unless you configure [it] not to.
So would it be preferable to use one of these methods in a particular situation, or do they basically end up doing the same thing?
(Bonus point for examples:)