New:Socket for Asana Is Now Available.Learn more
Get Started

git-merged-branches

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-merged-branches

CLI tool to list all Git branches merged into a base branch with issue link formatting

latest
Source
npmnpm
Version
0.5.1
Version published
Weekly downloads
15
-37.5%
Maintainers
1
Weekly downloads
 
Created
Source

git-merged-branches

npm version npm downloads build socket

git-merged-branches is a command-line utility to view branches merged into a selected base branch (e.g., master or main).

  • CLI usage
  • customizable via package.json

Installation

Install globally to use git-merged-branches or the shorter version gmb:

npm install --global git-merged-branches

Or use it without installation via npx:

npx git-merged-branches

Usage

By default, the command shows merged branches into the base branch (master or main). If neither exists, it will notify you.

Example output:

$ git-merged-branches
2 branches merged into master:
fix/crash-on-start
feat/add-new-feature

You can also delete these merged branches with the --delete option:

$ git-merged-branches --delete
2 branches merged into master:
fix/crash-on-start
feature/add-new-feature

Deleting branches locally…
Deleting branches remotely…
Branches deleted successfully.

Configuration

You can configure the utility in your package.json under git-merged-branches. This allows you to set:

  • issueUrlFormat: Base URL for your issue tracker (must be a valid URL).
    • For JIRA-style trackers, you can can include the prefix in the URL: https://your-jira-instance.net/browse/{{prefix}}{{id}}.
    • Fir GitHub-style issues, omit the prefix in the URL: https://github.com/org/repo/issues/{{id}}.
  • issueUrlPrefix: Array of prefixes for issue identifiers in branch names.

Example configuration for JIRA:

"git-merged-branches": {
  "issueUrlFormat": "https://your-jira-instance.net/browse/{{prefix}}{{id}}",
  "issueUrlPrefix": ["TOKEN-", "PROJECT-"]
}

Example configuration for GitHub:

"git-merged-branches": {
  "issueUrlFormat": "https://github.com/org/repo/issues/{{id}}",
  "issueUrlPrefix": ["#"]
}

With this setup, git-merged-branches will generate links for branches with such tokens in their name:

$ git-merged-branches
4 branches merged into master:
fix/EXTERNAL-391
fix/TOKEN-123_some-fix https://your-jira-instance.net/browse/TOKEN-123
hotfix
TOKEN-800_new-feature https://your-jira-instance.net/browse/TOKEN-800
refactor/#55_cleanup https://github.com/org/repo/issues/55

If the configuration is invalid, warnings will be shown and the utility will skip formatting URLs.

Development

To contribute or test locally:

  • Clone the repository:

    git clone https://github.com/VChet/git-merged-branches.git
    cd git-merged-branches
    
  • Install dependencies:

    pnpm install
    
  • Build the project:

    pnpm run build
    
  • Link it locally for testing:

    npm link
    

Now you can run git-merged-branches on your local machine.

Security notes

Git commands are executed via child_process.execFileSync, eliminating shell injection risks. Network access originates from Git operations, e.g. git ls-remote, not from the application itself.

Contributing

If you have any ideas, bug reports, or feature requests, feel free to contribute or report issues.

Keywords

git

FAQs

Package last updated on 18 Aug 2026

Related posts