npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gitbash

v1.9.1

Published

Opinionated git utilities for bash with fzf-powered menus

Readme

gitbash

Pure bash, zero-dependency git utilities. Reduce repetitive typing and supercharge git workflows with optional interactive previews and safe cleanup — see a full comparison.

screenshot-status.png

Installation

Via npm

npm i -g gitbash && gitbash --config

Options

gitbash --help         # Show help
gitbash --version      # Show version
gitbash --init         # Print shell init code
gitbash --config       # Interactive configuration wizard
gitbash --config-local # Configure local overrides for current repository
gitbash --config-user  # Configure user-specific overrides (excluded from git)

Dependencies

# Optional (recommended)
brew install fzf        # Interactive menus and previews
brew install git-delta  # Better diff highlighting
brew install bat        # File preview with syntax highlighting

Commands

branch

Interactive menu for branch operations (create/switch/update).

branch              # Interactive menu
branch -h           # Show help
branch --version    # Show version

create

create [JIRA_LINK|ISSUE] [TITLE...]

Create feature branch with optional Jira parsing. Updates main first, pushes and tracks.

Branch Name Format: <type>/<custom-prefix>/<issue>-<title> or <type>/<custom-prefix>/<title>

Examples with custom prefix (GITBASH_CREATE_BRANCH_PREFIX="awesome-team"):

With issue parsing enabled (default):

create PROJ-123 fix login bug           # → feature/awesome-team/PROJ-123-fix-login-bug
create fix bug                          # → feature/awesome-team/NOISSUE-fix-bug
create --hotfix PROJ-999 critical fix   # → hotfix/awesome-team/PROJ-999-critical-fix
create                                  # Interactive mode with Jira prompt

With issue parsing disabled (GITBASH_CREATE_NO_ISSUE_PARSING="yes"):

create fix login bug                    # → feature/awesome-team/fix-login-bug
create --hotfix enhance security        # → hotfix/awesome-team/enhance-security
create                                  # Interactive mode (no Jira prompt)

Examples with empty prefix (GITBASH_CREATE_BRANCH_PREFIX="", default):

With parsing enabled:

create PROJ-123 fix bug                 # → feature/PROJ-123-fix-bug
create fix bug                          # → feature/NOISSUE-fix-bug

With parsing disabled:

create enhance login screen             # → feature/enhance-login-screen

switch

switch [FILTER...]

Switch branches with fzf. Shows local first, then remotes (deduped). Preview shows commit history.

switch              # Browse all branches
switch captcha      # Pre-filter for "captcha"

commit

commit [MESSAGE] [-p|--push] [-s|--staged]

Commit with optional push. Smart staging: prompts if both staged/unstaged exist.

commit fix bug           # Commit all
commit -s fix bug        # Commit staged only
commit -p add feature    # Commit and push

status

Interactive staging with fzf. Toggle files with Enter, ESC to exit. Shows diffs in preview.

pr

pr [-p|--push]

Open PR in browser. -p pushes first.

update

update [-p|--push]

Merge latest main/master into current branch. Opens merge tool on conflicts.

stale

stale [-a|--all] [--age=N] [--json] [FILTER...]

List remote branches >3 months old (oldest first). Multi-select with TAB to delete.

  • By default, pre-filters by your git username (from git config user.name)
  • -a|--all shows all branches without username filter
  • --age=N sets stale threshold in months (default: 3, or GITBASH_STALE_MONTHS)
  • Ctrl-A toggles showing all branches (including recent ones)
  • --json outputs JSON for scripting (same format as cleanup)

stashes

Interactive stash menu: create, apply, or delete stashes.

stash

stash [NAME...]

Create named stash (includes untracked files).

unstash

Apply stash with fzf picker. Optionally drop after applying.

cleanstash

Delete stashes (multi-select with TAB).

cleanup

cleanup [--json]

Find and delete leftover local branches. Shows all local branches categorized:

  • [MERGED] - Remote was deleted (pre-selected)
  • [STALE] - No commits in 7+ days (pre-selected)
  • [RECENT] - Recent activity (not selected)

Switches to main/master first if current branch is selected for deletion.

--json outputs non-interactive JSON for scripting:

[
  {
    "last_change_timestamp": 1733123456,
    "author_email": "[email protected]",
    "author_name": "Dev",
    "name": "feature/old",
    "last_change_relative": "2 weeks ago"
  }
]

commits

commits [COUNT]

List recent commits with option to revert. Multi-select with TAB to revert multiple.

commits        # Show last 20 commits
commits 50     # Show last 50 commits

Configuration

gitbash reads configuration from ~/.gitbashrc if it exists. You can set the following variables:

# Branch prefix inserted between type and issue number (default: "")
# No trailing slash needed - it's added automatically
# Format: <type>/<prefix>/<issue>-<title> or <type>/<prefix>/<title>
# Examples: "awesome-team" or "" for no prefix
GITBASH_CREATE_BRANCH_PREFIX=""

# Merge tool command invoked by 'update' when conflicts occur (default: "fork")
GITBASH_MERGE_COMMAND="fork"

# Disable Jira issue number parsing in branch names: yes or no (default: "no")
GITBASH_CREATE_NO_ISSUE_PARSING="no"

# Fallback prefix when no issue number is provided (default: "NOISSUE")
# Only used when GITBASH_CREATE_NO_ISSUE_PARSING="no"
GITBASH_CREATE_ISSUE_PARSING_FALLBACK="NOISSUE"

# Theme for delta/bat diff highlighting: auto, dark, or light (default: "light")
GITBASH_THEME="light"

# Stale branch threshold in months for 'stale' command (default: 3)
GITBASH_STALE_MONTHS=3

# Cleanup threshold in days - branches merged more than this many days ago (default: 7)
GITBASH_CLEANUP_DAYS=7

You can create this file manually or use gitbash --config to configure interactively.

Local Configuration

gitbash also supports repository-specific configuration overrides. Run gitbash --config-local inside a git repository to create a .gitbashrc file in the repository root.

Local settings override the global ~/.gitbashrc for that repository only. This is useful for:

  • Different branch prefixes per project (e.g., team names)
  • Project-specific issue parsing settings
  • Different stale/cleanup thresholds per repository

The interactive wizard will show each setting's current global value and ask if you want to override it locally. Only overridden values are written to the local config.

User Configuration

For personal settings that should not be committed to version control, run gitbash --config-user to create a .gitbashrc-user file in the repository root.

User settings override both global (~/.gitbashrc) and local (.gitbashrc) settings. The file is automatically added to .gitignore.

Configuration priority (highest to lowest):

  1. .gitbashrc-user - User-specific settings (not committed)
  2. .gitbashrc - Repository settings (can be committed)
  3. ~/.gitbashrc - Global settings

Individual aliases

Instead of adding every command via eval "$(gitbash --init)" in .zshrc or .bashrc direct usage with gitbash [command] is also possible. Or if desired, individual aliases can be made.

alias branch="gitbash branch"
alias cleanstash="gitbash cleanstash"
alias cleanup="gitbash cleanup"
alias commit="gitbash commit"
alias commits="gitbash commits"
alias create="gitbash create"
alias pr="gitbash pr"
alias stale="gitbash stale"
alias stash="gitbash stash"
alias stashes="gitbash stashes"
alias status="gitbash status"
alias switch="gitbash switch"
alias unstash="gitbash unstash"
alias update="gitbash update"

License

See LICENSE file for details.