Skip to content

Instantly share code, notes, and snippets.

@siketyan
Created August 26, 2022 05:14
Show Gist options
  • Save siketyan/9c6694fc4f7524283f1667f0cde987e8 to your computer and use it in GitHub Desktop.
Save siketyan/9c6694fc4f7524283f1667f0cde987e8 to your computer and use it in GitHub Desktop.
Deletes Git branches that was merged on GitHub (using gh CLI).
for b in (gh pr list -A "@me" -s merged --json headRefName | jq -r '.[].headRefName')
git branch -d "$b" || true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment