Documentation Index
Fetch the complete documentation index at: https://gx.mubbie.dev/llms.txt
Use this file to discover all available pages before exploring further.
gx nuke deletes branches thoroughly: local branch, remote tracking ref, and remote branch in one operation. It supports glob patterns for batch deletion and has safety guards to prevent accidents.
Usage
Arguments
| Argument | Description |
|---|---|
branch-or-pattern | Branch name or glob pattern (e.g., feature/*) |
Flags
| Flag | Short | Description |
|---|---|---|
--local | Only delete the local branch (skip remote) | |
--dry-run | Show what would be deleted without making changes | |
--yes | -y | Skip confirmation prompts |
--orphans | Delete all orphaned branches from the stack |
Examples
Safety Guards
gx nuke includes several safety measures:| Guard | Behavior |
|---|---|
| Current branch | Cannot nuke the branch you are on. gx prints ERROR Cannot nuke '<branch>': it's the current branch. Switch first. |
| HEAD branch | Cannot nuke main/master. gx prints ERROR Cannot nuke '<branch>': it's the HEAD branch. Blocked for safety. |
| Unmerged warning | Branches not merged into the HEAD branch are flagged with a prominent warning |
| Stack children | If the branch has dependent branches in the stack, gx warns they will become orphaned |
| Confirmation | Always asks for confirmation (unless --yes), and always asks when unmerged branches are involved even with --yes |
Merged vs Unmerged
- Merged branches are deleted with
git branch -d(safe delete) - Unmerged branches are deleted with
git branch -D(force delete)
git branch --merged.
Orphan Mode
gx nuke --orphans finds all branches in the stack config whose parent no longer exists and offers to delete them in batch. This is useful after merging and deleting parent branches.
Details
Details
- Glob patterns are resolved against all local branches
- Remote deletion uses
git push origin --delete <branch> - Remote tracking refs are cleaned up with
git branch -dr origin/<branch> - After deletion, the branch is removed from the stack config
- When a branch is removed from the config, its children are also removed (they become orphaned)