“Git poda las ramas locales” Código de respuesta

Git poda las ramas locales

# 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
Envious Elk

Git poda las ramas locales

# 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.
Goofy Goober

Git Prune ramas remotas

git remote prune origin
foloinfo

Git elimina las ramas remotas eliminadas

git fetch origin --prune
Clever Corncrake

Ramas locales limpias git

git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
Condemned Capybara

Git poda las ramas locales

npx git-removed-branches --prune
Cooperative Centipede

Respuestas similares a “Git poda las ramas locales”

Preguntas similares a “Git poda las ramas locales”

Más respuestas relacionadas con “Git poda las ramas locales” en Shell/Bash

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código