Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Repository files navigation

git-orchard

A tmux-native TUI for managing git worktrees. Browse worktrees, preview live session content, and switch between them — all without leaving your terminal.

TypeScript React Ink License: MIT

How it works

Orchard runs as a persistent named tmux session. Each worktree you open becomes its own tmux session. The orchard session stays alive in the background, auto-refreshing every 60 seconds, and you can jump back to it at any time with ^B o.

orchard session (persistent, auto-refreshing)
├── worktree list + live preview
└── ^B o from any worktree session returns here

feat/login session
├── your shell / editor / claude
└── status bar: branch  PR#42 ◌ review  │  ^B o orchard  ^B ( prev ...

Features

  • Worktree list with branch, PR status, and review state
  • Live pane preview — see what's running in each session before switching
  • Switch sessions with Enter — creates the session if it doesn't exist
  • Remote worktrees — browse and jump into remote tmux sessions over SSH or mosh
  • Worktree transfer — push/pull worktrees between local and remote machines
  • Merge conflict detection — shows conflicts as top-priority status badge
  • Issue tracking — links worktrees to GitHub issues and shows issue state
  • Consistent tmux UI — every session gets the same styled status bar with a cheatsheet
  • PR status from GitHub — failing CI, unresolved threads, changes requested, approved
  • Open PRs in browser — jump straight to GitHub
  • Delete worktrees with confirmation
  • Batch cleanup — remove all worktrees with merged/closed PRs
  • Auto-refresh — list updates in the background every 60s
  • JSON output--json flag for machine-readable worktree data

Install

npm install -g git-orchard

Setup

git-orchard init

Add the printed shell function to your ~/.zshrc or ~/.bashrc, then reload:

source ~/.zshrc

This creates an orchard command that creates and attaches to the persistent orchard tmux session. Always use orchard, not git-orchard directly.

Usage

orchard          # Open the orchard session (creates it if needed)
orchard cleanup  # Jump straight to cleanup view
orchard init     # Print shell function
orchard --json   # Output worktree data as JSON and exit

Keybindings in orchard

Key Action
↑ / ↓ Navigate worktrees
1-9 Jump to worktree by number
enter Switch to worktree tmux session (creates if needed)
o Open PR in browser
p Push/pull worktree to/from remote
d Delete selected worktree
c Cleanup worktrees with merged/closed PRs
r Refresh list
q Quit

Tmux cheatsheet (shown in every session's status bar)

Binding Action
^B o Switch to orchard session
^B ( / ^B ) Previous / next session
^B % Split pane vertically
^B " Split pane horizontally
^B ←→ Navigate panes
^B z Zoom pane
^B x Close pane
^B d Detach session

Remote Worktrees

Orchard can display and manage worktrees on a remote machine. Configure a remote in .git/orchard.json (or .git/modules/<name>/orchard.json for submodules):

{
  "remote": {
    "host": "ubuntu@10.0.3.56",
    "repoPath": "~/project/bare-repo",
    "shell": "mosh"
  }
}
Field Description
host SSH host (user@hostname)
repoPath Path to the bare repo on the remote
shell "ssh" (default) or "mosh" for the connection

Press Enter on a remote worktree to open a local tmux session that connects to the remote tmux session via SSH/mosh. Press p to transfer a worktree between local and remote.

Requirements

  • Node.js 18+
  • Git
  • tmux
  • GitHub CLI (gh) — optional, for PR status

Contributing

  1. Fork the repo and create a feature branch
  2. Follow SOLID, KISS, YAGNI, and CUPID principles
  3. Write tests for pure functions (BetterSpecs style)
  4. Run npm test and make sure everything passes
  5. Open a PR
npm install
npm test         # Run tests
npm run build    # Compile TypeScript

License

MIT

About

Interactive TUI for managing git worktrees, PR status, and tmux sessions

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages