Open-core · zero runtime dependencies · CI-native exit codes

Your branch policy, actually enforced.

branchpol scans your remotes for naming and protection violations — wip, banned defaults, missing protection branches — reports them, and exits non-zero so CI blocks the merge.

npm i -g branchpol See how it works
~/acme-api — branchpol
$ branchpol check
branchpol — origin · 14 branches scanned

  wip
     forbidden pattern: matches forbidden pattern ^wip$
  TEMP-auth-retry
    ! case: should be lowercase (a-z, 0-9, . _ / -)

1 error(s), 1 warning(s)

$ echo $?
1   ← CI fails the job

Everything the retro promised, in one config file

Branch conventions only work when something checks them on every push.

🌿

Naming policy

Require patterns like feat/* or release/*, forbid wip/master/deny-lists, enforce lowercase names and a max length.

🛡️

Protection policy

Required branches must exist on the remote, banned branches must not, and the remote's default branch must match your policy.

🕸️

Remote scanning, zero fetch

Reads branches straight from the remote with read-only git plumbing. No checkout, no working-tree changes, safe anywhere.

🤖

CI-native

Non-zero exit on violations, JSON output for tooling, and GitHub Actions annotations that show up inline on pull requests.

🍂

Staleness sweep

Flag tracking branches with no commits for 90+ days before they become someone's archaeology project.

Zero dependencies

Built on Node built-ins and the git CLI you already have. Install globally, run offline with --local, trust nothing else.

How it works

Three steps from "we should really fix our branches" to an enforced policy.

branchpol init

Declare policy

Creates a documented branchpol.config.json: required patterns, deny-lists, protected branches, staleness.

branchpol check

Scan & report

Lists every remote branch via read-only git commands and lints each one against your rules.

exit 1

Enforce in CI

Violations fail the job — locally, in GitHub Actions (with inline annotations), or any CI that understands exit codes.

Pricing

The CLI is free and MIT-licensed. Pay when you want organization-wide enforcement.

Community
$0
  • Full CLI — check, protect, report
  • Open source (MIT)
  • JSON + GitHub Actions output
  • Offline mode
Install

Try it in 30 seconds

Runs on macOS, Linux and Windows. Requires Node 18+ and git.

terminal
$ npm install --global branchpol
$ cd my-project && branchpol init
$ branchpol check
✓ no policy violations

FAQ

Does it need access to my repos or CI?

No. It's a local CLI that shells out to read-only git commands against whatever remote you configure. Nothing is uploaded anywhere.

Will it modify my repository?

No. Scanning uses git ls-remote and git for-each-ref — both strictly read-only. With --fetch it runs git fetch --prune, which only updates remote-tracking refs.

What if we don't use GitHub?

Fine. The core scan works with any git remote. Only the protect command emits GitHub-specific payloads.

What's the license?

The CLI is MIT. Branchpol Pro is a separate paid product.