I have a local branch, say hotfix
. I put it up on GitHub using
$ git push -u origin hotfix
Then after merging the branch, I want to delete it. So I type
$ git branch -d hotfix
which deletes the branch locally. However, the remote branch is still on GitHub. Of course when I look at my remote branches,
$ git branch -r
origin/HEAD -> origin/master
origin/hotfix
origin/master
hotfix
is still there. So then I try
$ git branch -r -d origin/hotfix
$ git branch -r
origin/HEAD -> origin/master
origin/master
and hotfix
is gone, as expected.
But then I go to GitHub and look at my branches, and hotfix
is still there! How can I delete the remote hotfix
from GitHub via the command line, without having to navigate to GitHub in my browser and delete it using the Website UI?