xxxxxxxxxx
checkout other branch first
git branch -d <branch>
xxxxxxxxxx
// delete branch locally
git branch -d localBranchName
//delete local branch that is unmerged
git branch -D localBranchName
// delete branch remotely
git push origin --delete remoteBranchName
xxxxxxxxxx
## git version 2.25.1
## Deleting local branches
git branch -d localBranchName
## Deleting remote branches
git push origin --delete remoteBranchName
## Deleting both a local and a remote branch
## They are completely separate objects in Git. But
git branch -d localBranchName && git push origin --delete remoteBranchName
xxxxxxxxxx
// delete branch locally
git branch -d branchName
//delete unmerged local branch
git branch -D branchName
// delete branch remotely
git push origin --delete branchName
xxxxxxxxxx
We can delete a branch by calling the branch command and passing in the -d option, followed by the branch name.
$ git branch -d <branchname>