gh repo edit --delete-branch-on-merge=true

Category: GitHub CLI

gh repo edit --delete-branch-on-merge=true

Auto-delete head branches on merge

Turns on delete-branch-on-merge for the current repository so merged PR branches are cleaned up automatically. Set to false to disable. This is a repo-level setting that keeps the branch list tidy with zero manual work.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.