Create a shell-powered alias.
Section: Aliases, Extensions, and Completion
Create a shell alias
bash
bash
gh alias set cleanup '!git branch --merged | egrep -v "(^\*|main|master)" | xargs -r git branch -d'Explanation
Create a shell-powered alias.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Aliases, Extensions, and Completion