Skip to main content

git, made fluent.

gitbasher is a single-file bash CLI that wraps git. One short command per workflow — conventional commits, smart sync, AI commit messages (optionally fully local), safe rollback. Pure bash, no dependencies, MIT licensed.

curl -fsSL https://raw.githubusercontent.com/maxbolgarin/gitbasher/main/install.sh | bash

Linux · macOS · WSL · runs on bash 3.2+ · other install methods

$ gitb
gitbasher v4.0.0 — git, made fluent

usage: gitb <command> [mode]

DAILY
  status (s)                  Show repo state and changed files
  commit (c, co, com)         Create commits — interactive, AI, amend, revert
  push (p, ps, pus)           Push current branch safely
  pull (pu, pl, pul)          Pull from remote
  sync (sy)                   Sync current branch with main

BRANCHES
  branch (b, br, bran)        Switch, create, clean up branches
  merge (m, me)               Merge branches
  rebase (r, re, base)        Rebase, autosquash, pull commits
  squash (sq, tidy)           AI-group commits into clean history
  cherry (ch, cp)             Cherry-pick commits from other branches
  prev (-)                    Switch to previous branch (like cd -)

HISTORY
  log (l, lg)                 Pretty git log with branch comparison
  reflog (rl, rlg)            Pretty git reflog
  tag (t, tg)                 Create, list, push, fetch, delete tags

RECOVERY
  undo (un)                   Undo commit, amend, merge, rebase, stash
  reset (res)                 Preview and apply git reset flows
  stash (st, sta)             Manage git stashes
  wip (w)                     Stash WIP, optionally back up to remote

SETUP
  clone (cl, clo)             Clone a remote repo and initialize gitbasher
  origin (or, o, remote)      Manage remotes
  hook (ho, hk)               Manage git hooks
  worktree (wt, tree)         Manage git worktrees
  config (cf, cfg, conf)      Configure gitbasher
  update (up, upd)            Check for and install updates
  uninstall (uns, uni)        Remove gitbasher config and binary

Run gitb <command> help for modes and examples

Recipes #

Real flows people run every day. Copy the gitbasher line and paste it into your terminal.

Start a feature off the latest main

Fetches main, fast-forwards it, then creates a conventionally-named branch from the updated tip — without leaving your current directory.

gitb branch newd
What this expands to in plain git
git fetch origin main
git checkout main
git pull --ff-only
git checkout -b feat/<your-name>

Commit + push in one flow (with an AI message)

Stages everything, drafts a conventional message from your diff, lets you confirm, commits, then pushes. Use a hosted provider or run Ollama locally — your call.

gitb commit ai fast push
What this expands to in plain git
git add -A
git diff --cached  →  llm  →  "feat(scope): subject"
git commit -m "..."
git push -u origin HEAD

Catch your branch up to main mid-feature

Fetches main, rebases your branch on top, then force-pushes with --force-with-lease if you ask. No more "git fetch && git rebase origin/main && git push --force-with-lease" muscle memory.

gitb sync push
What this expands to in plain git
git fetch origin main
git rebase origin/main
git push --force-with-lease

Save WIP and pick it up on another machine

Stashes everything, pushes a backup branch to origin/wip/<branch>, and leaves you with a clean tree. On the other machine, gitb pull fetches it and gitb wip down restores and cleans up.

gitb wip up # save gitb wip down # restore
What this expands to in plain git
git stash push -u
git push origin "HEAD:wip/$(git symbolic-ref --short HEAD)"
# … later …
git stash pop
git push origin :wip/<branch>

Undo a mistake — anything, really

One command for commit / amend / merge / rebase / stash. It picks the right reflog reference, previews the change, and waits for your confirmation. Recoverable by design.

gitb undo # last commit gitb undo amend # restore pre-amend state gitb undo rebase # abort or revert the rebase
What this expands to in plain git
git reset --soft HEAD~1
git reset --hard ORIG_HEAD
git rebase --abort

Clean up a messy feature branch into changelog-ready commits

gitb proposes a squash plan (groups, messages, order) and applies it once you confirm.

gitb squash
What this expands to in plain git
git rebase -i origin/main
# fold, reorder, rewrite messages — by hand

AI commit messages #

gitb commit ai reads your staged diff, asks an LLM to write a Conventional Commit message, and lets you confirm before committing. Pick a hosted provider — OpenAI or OpenRouter (Gemini, Claude, GPT, DeepSeek, …) — or pick Ollama and keep the entire flow on localhost. Switch providers any time with one command.

Fully local with Ollama

No key, no network, your diff doesn't leave the machine.

# one-time brew install ollama # or follow ollama.com for your OS ollama serve & # daemon, leave running ollama pull qwen3:8b # or any model you like gitb cfg ai # pick "ollama" + the pulled model # from now on gitb commit ai # diff → localhost:11434 → message

Hosted provider (OpenAI or OpenRouter)

Keys are checked in order: environment variable → per-repo config → global config. Prefer env vars on shared machines.

# pick OpenAI or OpenRouter gitb cfg ai # keep keys out of git config (resolved first): export GITB_AI_API_KEY_OPENAI=sk-... export GITB_AI_API_KEY_OPENROUTER=sk-or-...

The hosted provider's data-retention policy applies when you use it. Pick Ollama if that matters for your team.

Install #

Pick whichever fits. After install, gitb update upgrades in place from the latest GitHub release.

Recommended. Drops gitb in ~/.local/bin, no sudo. Verifies SHA-256.

curl -fsSL https://raw.githubusercontent.com/maxbolgarin/gitbasher/main/install.sh | bash

Upgrade with gitb update. Remove with gitb uninstall. Full guide: install docs on GitHub .

FAQ #

Long-form answers and more questions in the FAQ on GitHub .

Does it send my code anywhere?
Only when you opt in. gitb commit ai with a hosted provider sends the staged diff to that provider — their data-retention policy then applies. Pick Ollama to keep everything on localhost. Nothing else in gitbasher makes outbound calls except the self-update check.
What platforms does it run on?
Linux, macOS, and Windows under WSL. Runs on bash 3.2+, the version macOS ships as /bin/bash — so it works on a stock Mac with no extra install. A newer bash is optional and only improves in-place editing of pre-filled prompts.
Does it interfere with my existing git workflow?
No. gitbasher just calls git under the hood. gitb is a separate binary — keep using plain git whenever you want.
Where are my settings (and API keys) stored?
In git config under the gitbasher.* namespace — per-repo by default, or global with gitb cfg g. For shared machines, set API keys via env vars like GITB_AI_API_KEY_OPENAI; gitbasher checks env first.
Does it work in CI?
Non-interactive subcommands, yes. Anything that prompts will block on stdin — use explicit modes (gitb commit fast, gitb push -y) for CI scripts.
How do I update or uninstall?
gitb update self-updates from the latest GitHub release (SHA-256 verified). gitb uninstall removes the binary and config keys.