Skip to content

Instantly share code, notes, and snippets.

@bholloway
Last active February 14, 2023 05:49
Show Gist options
  • Save bholloway/322fbbd8d06cb7685f5ea8d352a1e6ce to your computer and use it in GitHub Desktop.
Save bholloway/322fbbd8d06cb7685f5ea8d352a1e6ce to your computer and use it in GitHub Desktop.
Remove references to remote branches without removing from remote
git branch -r | grep -v "origin/master$" | tr -d "[:blank:]" | tr "\n" "\0" | xargs -0 git branch -d -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment