How To Delete a Git Branch - Locally and Remotely
1 min read

Delete a local branch

Deleting a local branch is the simplest of the two.

git branch -d branchToDelete

If you have unstaged changes, you need to force the removal with a capital D instead.

git branch -D branchToDelete

Delete a remote branch

Deleting a branch remotely actually requires a push, but it’s quite simple as well.

git push origin --delete branchToDelete