Git Remove Local and Remote Branch


I always have to look this up.. here is hoping that typing it out will help me remember.

To delete the remote branch

git push --delete <remote-name> <branch-name>

To delete the local branch is just as easy

git branch -d branch-name

Git is going to sanity check you with a lowercase flag because deleting a branch is a big deal, so if you're sure just go ahead and use the flag with a capital letter.

git branch -D branch-name

Archive