Horje
git prune local branches Code Example
git prune local branches
# for pruning of local branches that have been deleted on remote
git remote prune origin

# for checking local branches and if they can be deleted
# because they have been merged into another branch already
git branch --merged >/tmp/merged-branches && \
  vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches
git prune remote branches
git remote prune origin
git prune local branches
# To delete local old/merged branches:
git fetch --prune
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d

# This string gets the list of remote branches and passes it into egrep through the standard input. And filters the branches that have a remote tracking branch (using git branch -vv and filtering for those that have origin) then getting the first column of that output which will be the branch name.
# Finally passing all the branch names into the delete branch command.
# Since it is using the -d option, it will not delete branches that have not been merged into the branch that you are on when you run this command.
# Also remember that you'll need to run git fetch --prune first, otherwise git branch -r will still see the remote branches.
clean local branches git
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
git remove deleted remote branches
git fetch origin --prune
git prune local branches
npx git-removed-branches --prune




Shell

Related
revert to commit git Code Example revert to commit git Code Example
To exclude directory with particluar pattern : Code Example To exclude directory with particluar pattern : Code Example
merge child branch to parent git Code Example merge child branch to parent git Code Example
Run node red in widnows Code Example Run node red in widnows Code Example
bash debugging Code Example bash debugging Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12