I want to delete a branch both locally and remotely.
$ git branch -d
I got sick of googling for this answer, so I took a similar approach to the answer that crizCraig posted earlier.
I added the following to my Bash profile:
function gitdelete(){
git push origin --delete $1
git branch -D $1
}
Then every time I'm done with a branch (merged into master
, for example) I run the following in my terminal:
gitdelete my-branch-name
...which then deletes my-branch-name
from origin
as as well as locally.