delete branch local and remote git code example

Example 1: remove branch git

// 1. delete branch locally
git branch -d localBranchName

// 2. delete branch remotely
git push origin --delete remoteBranchName

// 3. DONE!

Example 2: git delete origin branch

$ git push -d <remote_name> <branch_name>
$ git branch -d <branch_name>

Example 3: delete branch local and remote git

// delete branch locally
git branch -d localBranchName

// delete branch remotely
git push origin --delete remoteBranchName

Example 4: How to Delete Local/Remote Git Branches

$ git branch -a

# *master
# b1
# remote/origin/master
# remote/origin/b1

$ git push origin --delete b1
# [...]
# - [deleted] b1

Tags:

Misc Example