jit-git
v0.1.2
Published
A simple but powerful OpenTUI Git client.
Maintainers
Readme
Jit
Jit is a Bun-powered Git TUI that aims to make common JetBrains-style Git workflows fast from the terminal: selected commits, branch switching, cherry-pick, squash, push/pull previews, recoverable shelves, and Changesets support.
Install
# Try without installing (npm, pnpm and bun all work)
npx jit-git
pnpm dlx jit-git
bunx jit-git
# Install globally; the command is `jit`
npm i -g jit-git # or: pnpm add -g jit-git / bun add -g jit-git
# Homebrew (macOS and Linux)
brew install mr47/tap/jitPrebuilt binaries for macOS (arm64, x64) and Linux (arm64, x64) are also attached to each GitHub release. No Bun or Node runtime is needed to run them.
Releasing
Releases are driven by a tag and .github/workflows/release.yml:
# 1. bump "version" in package.json and commit
git tag v0.2.0 && git push origin v0.2.0CI compiles one binary per platform on a native runner, creates the GitHub release, publishes the npm packages, and updates the Homebrew tap. Required one-time setup:
- npm: pick the package name (
jit-gitby default, override withJIT_NPM_NAME). Publishing uses npm trusted publishing (OIDC), so no long-lived token is needed after the first release:- First release only: store a temporary npm automation token as the
NPM_TOKENrepo secret. It creates the packages, since trusted publishers can only be configured on packages that already exist. - On npmjs.com, open each of the 5 packages (
jit-gitandjit-git-{darwin-arm64,darwin-x64,linux-x64,linux-arm64}) -> Settings -> Trusted Publisher -> GitHub Actions: usermr47, repositoryjit, workflowrelease.yml, allownpm publish. Then set Publishing access to "Require two-factor authentication and disallow tokens". - Delete the
NPM_TOKENsecret. The next tag publishes through OIDC and the first such publish validates each configuration (it must happen within 2 days of creating it), with provenance added automatically.
- First release only: store a temporary npm automation token as the
- Homebrew: create a public repo
<you>/homebrew-tapand store a token with write access to it as theHOMEBREW_TAP_TOKENrepo secret.
Useful local commands:
bun run build # host binary -> dist/jit (also dist/jit-<os>-<arch>)
bun run package:npm # assemble dist/npm/* (needs binaries for every target)
bun run publish:npm -- --dry-run # same, then `npm publish --dry-run`
bun run package:release # tarballs, SHA256SUMS and the Homebrew formula in dist/releaseInstall From Source On macOS
bun install
bash scripts/install-macos.shBy default the installer writes jit to /usr/local/bin. On Apple Silicon Homebrew setups you can choose:
JIT_INSTALL_DIR=/opt/homebrew/bin bash scripts/install-macos.shDevelopment
bun install
bun run dev
bun run build
bun testUseful commands:
jitopens the TUI when run inside a Git repository.jit statusprints a compact repository snapshot.jit commit --message "msg" -- path/to/filecommits selected paths while leaving other worktree changes alone.jit stage,jit unstage,jit rollback, andjit backcover selected or all-change rollback.jit switch <branch>switches local branches, creates a tracking branch from a matching remote, or creates a new branch from the current commit when no match exists.jit branch list|create|rename|delete|trackcovers local and remote branch management.jit push-previewandjit update-previewshow network changes before applying them.jit fresh [branch]fetches, optionally switches branches, and updates with fast-forward only.jit update --freshis the current-branch shortcut for the same no-rebase update strategy.jit merge,jit rebase,jit pick,jit squash,jit revert, andjit resetcover history-editing workflows.jit drop <commit>removes a single commit from the current branch history.jit purge <path>removes a file from all unpushed commits (keeps it on disk, leaves a backup underrefs/original).jit remote,jit tag,jit shelf,jit conflicts, andjit comparecover the remaining standard WebStorm Git panels/actions.jit changeset statusreports Changesets state.jit ticketslists the Jira tickets (ABC-123, any 2-10 letters, case-insensitive) referenced in a range of history. It reads commit messages, merge commit messages, and the names of branches merged into the range (so fast-forwarded branches count too). See Jira tickets.jit featuresprints the WebStorm/JetBrains feature coverage matrix.
TUI
jit (no arguments) opens an interactive, WebStorm-style Git client:
- Changes list with checkboxes — like WebStorm's Commit tool window.
spacetoggles a file in the commit selection,aselects all/none. New changes are checked by default. File status uses JetBrains colors (blue modified, green added, red untracked, gray deleted). - History browser when clean — with nothing to commit, the main view shows the recent commit graph instead of an empty list:
j/kwalk commits with each commit's diff rendered live on the right,enterdrills into the commit's file tree. - Live diff preview — the right pane always shows the diff of the focused file (vs HEAD, untracked files included) with line numbers, background-tinted added/removed lines, clean hunk separators, and editor-style syntax highlighting (keywords, strings, numbers, comments, calls — 30+ file types detected by extension).
tabmoves focus to the diff for scrolling. - Commit / Commit and Push —
copens the commit dialog for the selected files only (other changes stay in the worktree, including partial selections),Ccommits and pushes. - Push and Update with previews —
p/ushow outgoing/incoming commits, files, and diff before you confirm;mcycles the pull strategy (rebase / merge / ff-only).ffetches. If the repo has no remote yet, an Add Remote dialog opens instead of an error — enter a URL and the original action (push / update / fetch) resumes automatically. - Branch popup —
blists local and remote branches in sections;/filters live for quick switching.enterchecks out with automatic shelving of dirty changes (restored after switch) — on a remote branch it creates a local tracking branch, fast-forwards a stale local one, or (when the local branch has diverged) asks WebStorm-style whether to rebase onto the remote or drop the local commits.yopens commits unique to the selected branch for searchable, multi-select cherry-picking (spaceselects,enterapplies).mmerges the selected branch into the current one (plain /--no-ff/ squash),ncreates a branch,xdeletes a local one. - Log —
lshows the commit log as a branch graph (all refs, like WebStorm's Log tab)./filters live by subject, author, or hash;enterdrills into a commit showing its changed-file tree on the left and the per-file diff on the right (j/kwalk files,tabswitches to diff scrolling). Quick actions:ycherry-picks,rreverts (merge commits ask which parent to keep; CLI:jit revert <merge> -m 1, thenjit revert --continue|--abort|--skipafter conflicts),xdrops a commit from the branch history (confirmed, unpushed work only),fremoves a file (an accidental.npmrc,.env, ...) from every unpushed commit while keeping it on disk as untracked. - Rollback —
rreverts local changes to the selected files after confirmation. - Stashes —
sstashes all changes (empty message = quick stash),Sbrowses every stash (manualgit stashentries included) to apply, unshelve, or drop. - Local changeset —
mmoves the focused file into a JetBrains-style local changeset shown in its own section: the file stays modified in the working tree but is never included in a commit, even with "select all". Perfect for.npmrc/.envtweaks you never want to push.magain moves it back; the list persists in.git/info/jit-local-changeset. - Settings —
,opens a small git config panel:user.name,user.email,init.defaultBranch,pull.rebase,push.autoSetupRemote. Each row shows the effective value and where it comes from (repo / global / default).enteredits the repo value,gedits the global one,xunsets (an empty value also unsets). - The view auto-refreshes, so external
gitactivity shows up while the TUI is open.?shows the full keymap.
The TUI uses high-contrast color groups so status is readable at a glance:
- Green: clean, selected, added, safe actions.
- Yellow/orange: modified, pending sync, or warnings.
- Red: conflicts, untracked paths, destructive/recovery actions.
- Blue/cyan/purple: branch, network, history, and command groups.
Jira tickets
jit tickets # everything since the latest tag (all history if untagged)
jit tickets v1.4.0 # v1.4.0..HEAD
jit tickets origin/main..HEAD # also: jit tickets <base> <head>
jit tickets -v # show where each ticket was found
jit tickets --json # machine-readable
jit tickets --project JIR,MM # only these prefixes
jit tickets --no-merges # ignore merge commit messages (branch names still count)
jit tickets --limit 200 # only the newest 200 commitsOutput is one upper-cased key per line, sorted by project then number, so it pipes cleanly (jit tickets | sort -u | paste -sd, -). "No tickets found" goes to stderr.
Extraction is a regex and is always the source of truth. A few look-alikes (UTF-8, SHA-256, step-1, ...) are ignored unless you name them with --project.
AI agent pass
--agent [auto|auggie|opencode] (or --ai) additionally hands the commit messages and branch names to a CLI agent, which adds a one-line summary per ticket (tab-separated after the key) and can spot spelling variants like JIR 123 or jir_123. The agent runs in an empty temp directory with the data in the prompt, so it never touches the repo. Every key it returns is checked against the real history; invented ones are dropped with a warning.
autotriesauggie, thenopencode, using whichever are onPATH; if one fails it moves on to the next.- If every agent fails (not logged in,
auggie --printdisabled for the account, timeout, unparseable answer) a warning is printed to stderr and the regex results are still printed. - Local models can be slow; raise the limit with
--timeout <seconds>(default 600).
WebStorm Git Coverage
Jit mirrors the standard WebStorm Git surface: Commit, Local Changes, Diff, Log, Branches, Fetch, Push, Update Project, Merge, Rebase, Cherry-Pick, Revert, Reset Current Branch, Rollback, Shelve Changes, Resolve Conflicts, Manage Remotes, Tags, and Compare with Branch.
The TUI exposes the day-to-day workflows interactively, while the CLI keeps every action scriptable for tests and automation.
Update Troubleshooting
Q: jit update fails because I forgot to add local files. What do I do?
jit update shelves local changes, including untracked files, before pulling and restores them afterward. If a remote update adds the same path as one of your untracked local files, the pull can finish but restoring your local file needs a manual choice. Jit keeps the shelf and prints the restore command:
git stash apply stash@{0}Resolve the file conflict, then drop the shelf when you are done:
git stash drop stash@{0}If you wanted those new files to be part of your branch before updating, stage or commit them first:
git add .
git commit -m "Save local work"
jit updateQ: jit update says I have unmerged files. What do I do?
You are already in the middle of a merge, rebase, cherry-pick, or similar operation with unresolved conflicts. Finish or abort that operation before updating:
git status
git add/rm <file>
git rebase --continue # if rebasing
git commit # if merging
jit updateTo abandon the current operation instead:
git rebase --abort # if rebasing
git merge --abort # if mergingQ: jit update says Cannot rebase onto multiple branches. What do I do?
Your current branch has more than one branch.<name>.merge value in Git config, so Git does not know which upstream branch to rebase onto. Pick the upstream you want, clear the ambiguous config, and set one tracking branch:
git branch --unset-upstream main
git branch --set-upstream-to=origin/main main
jit updateReplace main / origin/main with your branch and remote branch. Running jit update-preview first is safe; it will show the same quick guide instead of attempting a pull.
Safety Model
Jit shells out to the system git binary with explicit argv arrays. High-risk operations are modeled as recoverable operations and expose the underlying Git commands through an operation journal.
