Answers for "how to delete a branch in local git"

167

delete local branch

// 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
Posted by: Guest on April-07-2020
26

git remove branch

// delete branch locally
git branch -d localBranchName

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

// refresh branch list
git fetch -p
Posted by: Guest on July-03-2020
1

How to Delete Git Branch

## Delete Branch Locally
git branch -d localBranchName
## Delete Branch Remotely
git push origin --delete remoteBranchName
Posted by: Guest on July-17-2021
2

how to delete branch locally

$ git branch -d <local-branch>
Posted by: Guest on December-04-2020
2

remove branch local git

$ git branch -d branch_name
$ git branch -D branch_name
Posted by: Guest on December-13-2020
0

git delete local branch

[alias]
  gone = ! "git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"
Posted by: Guest on May-15-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language