🪴 Shreyas' Garden

Home

❯

Link Snippets

❯

Git Gone custom command to reove local but remotely deleted branches

Git Gone custom command to reove local but remotely deleted branches

Mar 31, 20261 min read

  • Link
  • git

Git Gone custom command to reove local but remotely deleted branches

git The alias is as follows in git config --global --edit

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

Graph View

Created with Quartz v4.5.2 © 2026

  • Main Website