Created
May 28, 2026 08:20
-
-
Save matejskubic/2daa3e9fb6937e2a114fe0ee10cbf246 to your computer and use it in GitHub Desktop.
git: delete obsolete local branches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git fetch --prune; git for-each-ref --format="%(refname:short) %(upstream:track)" refs/heads | ? { $_ -match "\[gone\]" } | % { git branch -d (($_ -split " ")[0]) } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment