How To Completely Delete Git Branch
Explains the commands and steps required to completely delete a git branch both locally and the remote server.
This post list the commands required to delete a git branch both locally and on the remote server.
Delete Branch Locally
The git command branch -d can be used to delete a branch locally.
# Delete local branch
git branch -d <branch name>
# Example - Delete the local branch dev
git branch -d dev
Delete Branch on Remote Server
The git command push can be used to delete a branch on the remote server as shown below for a remote server named origin.
# Delete remote branch
git push origin :<branch name>
git push --delete origin <branch name>
# Example - Delete the remote branch dev
git push origin :dev
git push --delete origin dev