Answers for "git delete local branch"

126

git delete local branch

// delete branch locally
git branch -d localBranchName

// delete branch remotely
git push origin --delete remoteBranchName
Posted by: Guest on February-14-2020
9

git delete local branch

git branch -d test
Posted by: Guest on August-12-2020
4

git delete local branch

$ git push -d <remote_name> <branch_name>
$ git branch -d <branch_name>
Posted by: Guest on June-11-2020
0

git delete local branch

$ git for-each-ref --format '%(refname:short) %(upstream:track)' |
  awk '$2 == "[gone]" {print $1}' |
  xargs -r git branch -D

Deleted branch fix-typo (was 7b57d4f).
Deleted branch grammar-fix (was 01257bd).
Posted by: Guest on May-15-2021
0

git delete local branch

# HowTo delete multiple git branches on MAC / Linux / Unix environments 
# git branch | grep "<RegXpattern>" | xargs git branch -D
# here's an example to delete multiple branches that starts with "branch"
git branch | grep "branch*" | xargs git branch -D
Posted by: Guest on May-14-2021
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