This glossary defines technical terms, jargon, and domain-specific concepts used within the git-merged-branches codebase. It serves as a reference for onboarding engineers to understand how Git operations and configuration data map to the system's implementation.
The primary branch against which other branches are compared to determine if they have been merged. The system automatically searches for main or master in that order of priority.
getDefaultTargetBranch in src/repo.ts checks for the existence of these branches using git show-ref.A Git state where the repository points to a specific commit rather than a named branch. The tool explicitly prevents execution in this state to avoid ambiguity during branch deletion.
isDetachedHead in src/repo.ts uses git symbolic-ref.A feature that transforms branch names containing issue identifiers (e.g., fix/PROJ-123) into clickable terminal links.
{{prefix}} and {{id}} are used in the issueUrlFormat string.formatSingleBranch in src/output.ts uses RegEx to extract IDs and replace placeholders.| Term | Definition | Code Entity |
|---|---|---|
| GMB | Shorthand alias for the git-merged-branches command. | package.json line 28 |
| Merged Branch | A branch whose tip is reachable from the Target Branch, excluding branches that point to the exact same commit as the Target Branch tip. | getMergedBranches src/repo.ts44-56 |
| Remote Branch | A branch that exists on the origin remote. The tool fetches these to determine if a remote deletion command should be suggested or executed. | fetchRemoteBranches src/repo.ts58-70 |
| Style Utility | A wrapper around Node.js util.styleText used for terminal ANSI coloring. | style src/helpers.ts15-22 |
The following diagrams bridge the gap between natural language concepts and the specific functions or files that handle them.
This diagram illustrates how the system moves from a raw Git repository to a filtered list of merged branches.
Sources: src/repo.ts8-15 src/repo.ts35-42 src/repo.ts44-56
This diagram shows how user-defined configuration in package.json influences the console output.
Sources: src/repo.ts72-81 src/output.ts24-37 src/output.ts6-22 src/validate.ts1-10
The deletion process is split into local and remote phases. The tool uses execFileSync with stdio: "inherit" to allow the user to see the standard Git output during the deletion process.
git branch --delete <branches> src/repo.ts83-85git push origin --delete <branches> src/repo.ts86-88deleteBranches src/repo.ts89-100The system relies on the node:child_process module to interface with the system's git binary.
execFileSync to avoid shell injection vulnerabilities by passing arguments as an array. README.md130-132git show-ref --verify to check for branch existence without parsing stdout. src/repo.ts26-33Sources: src/repo.ts1-101 src/index.ts1-32 src/output.ts39-67 src/helpers.ts1-23