glab(1)
π NAME π
glab-repo-prune β delete local Git branches whose merge request has been merged.
okay so welcome to the glab(1) manual, bestie β we're zooming in on glab repo prune, aka the branch-cleanup icon. β¨
πΈ SYNOPSIS πΈ
glab repo prune [flags]
π¦ DESCRIPTION π¦
Delete local Git branches whose merge request has been merged on GitLab. That's the whole vibe π.
By default, the command queries GitLab for each local branch and only deletes branches that have at least one merged merge request and no merge requests still open from the same source branch. no cap.
Protected branches, the default branch, and the currently checked-out branch are never deleted. periodt. π
This command only affects your local Git repository. Remote branches on GitLab are not touched β local only, iykyk. Your local repo is the main character here π .
Use --merged to skip the per-branch merge request lookup and instead rely on git branch --merged to decide which branches to delete. The default branch and protected branches are still fetched from GitLab in this mode. Falling back to Git is faster, but only detects fast-forward merges β squash and rebase merges look like distinct commits to Git and will not be reported as merged.
heads up bestie: --merged is the speedy route, but it misses squash and rebase merges. Don't let that catch you slipping π.
β¨ OPTIONS β¨
--dry-run[=false]β preview branches that would be deleted without deleting them. lowkey the peek-first move π-e,--exclude=[]β branch name or glob pattern to exclude. Comma-separated or repeated.--merged[=false]β usegit branch --mergedinstead of querying GitLab. Detects fast-forward merges only.-y,--yes[=false]β skip the confirmation prompt. say less and let it cook π₯
π«Ά OPTIONS INHERITED FROM PARENT COMMANDS π«Ά
-h,--help[=false]β show help for this command. literally here to help π«Ά
π EXAMPLE π
# Preview branches that would be deleted
glab repo prune --dry-run
# Delete branches with merged MRs (after confirmation)
glab repo prune
# Delete without confirmation
glab repo prune --yes
# Exclude additional branches by name or glob pattern
glab repo prune --exclude wip-*,demo-branch
# Detect merged branches with Git instead of GitLab (faster, but misses squash and rebase merges)
glab repo prune --merged
π SEE ALSO π
mwah π this page was Auto generated by spf13/cobra, dated Nov 2026, and it's part of the glab(1) manual β byeee bestie π
π¦ where this page comes from
- arch rolling: glab 1.128.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms