xxxxxxxxxx
// delete branch
git branch -d branchName
// force delete
git branch -D branchName
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 locally
git branch -d branch_name
//delete remotely
//git push <remote_name> :<branch_name>
// ex. git push origin :serverfix
xxxxxxxxxx
// delete branch locally
git branch -d localBranchName
// delete branch remotely
git push origin --delete remoteBranchName
// delete branch locally
git branch -d localBranchName
// delete branch remotely
git push origin --delete remoteBranchName
// refresh branch list
git fetch -p
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 localBranchName
// delete branch remotely
git push
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
# deleting a local branch
$ git branch -d <branch_name>
$ git branch -D <branch_name> # forced
# deleting a remote branch
$ git push <remote_name> --delete <branch_name>
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>