xxxxxxxxxx
git branch -d <branch_name>
git branch -D <branch_name>
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 localBranchName
## Delete Branch Remotely
git push origin --delete remoteBranchName
xxxxxxxxxx
// Delete local branch
git branch -d <local_branch_name>
// Delete remote branch
git push origin --delete <remote_branch_name>
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>