Skip to content

Instantly share code, notes, and snippets.

@cboudereau
Created January 19, 2026 14:56
Show Gist options
  • Select an option

  • Save cboudereau/f5dc0310c0d365742773090620b28b8a to your computer and use it in GitHub Desktop.

Select an option

Save cboudereau/f5dc0310c0d365742773090620b28b8a to your computer and use it in GitHub Desktop.
remove remote git branches
g branch --format='%(committerdate:iso-local);%(refname:short)' --list origin/* -r | awk -F ';' '{ print $2 }' | grep -v -e "origin/master" -e "origin/main" -e "origin$" | awk '{ print $1 }' | xargs -I{} echo g push origin --delete {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment