Repolode
coderabbitai

coderabbitai/git-worktree-runner

A Bash CLI that wraps git worktree to create, configure, and remove per-branch worktrees, with editor and AI agent launchers.

Stars
1,809
Forks
114
Open issues
11
Last commit
yesterday

What is it?

gtr (Git Worktree Runner) is a command-line tool that makes git worktrees easier to use. A worktree lets you check out several branches of the same repository in separate folders at once, so you can work on a feature, review a pull request, or run tests on main without stashing changes or switching branches. gtr wraps the raw git worktree commands with shorter ones such as `git gtr new`, `git gtr pr 123`, and `git gtr rm`.

Each new worktree can be set up automatically. gtr copies configuration and environment files matching configured patterns, runs post-create hooks such as installing dependencies, and can open the worktree in an editor or start an AI coding tool. Built-in adapters cover editors like Cursor, VS Code, and Zed, and AI tools like Claude Code, Codex, and Gemini CLI, while any other safe command on PATH can be used as a fallback. The `--porcelain` output mode gives scripts and coding agents a stable way to capture the new worktree's path.

Settings are stored in git config, with optional team-wide defaults in a `.gtrconfig` file. Hooks and editor or AI defaults from that file only run after the user approves them with `git gtr trust`. The tool runs on macOS, Linux, and Windows through Git Bash or WSL, and requires Git 2.17+ and Bash 3.2+.

Key features

  • 01Create, list, rename, and remove worktrees by branch name with short commands
  • 02Check out pull requests into worktrees with `git gtr pr`
  • 03Copy env and config files into new worktrees using include and exclude patterns
  • 04Run post-create hooks such as dependency installation
  • 05Open worktrees in supported editors or launch AI coding tools with built-in adapters
  • 06Clean up worktrees whose PRs or MRs have been merged or closed

Use cases

  • Reviewing a teammate's pull request without interrupting current feature work
  • Running several AI coding agents in parallel, each on its own branch
  • Keeping a clean worktree on main for running tests or builds
  • Standardizing per-branch setup such as env files and dependency installs across a team

Quick start

  1. 1

    Install via Homebrew (macOS)

    brew tap coderabbitai/tap && brew install git-gtr
  2. 2

    Or clone the repository

    git clone https://github.com/coderabbitai/git-worktree-runner.git
  3. 3

    Run the installer from the checkout

    ./install.sh
  4. 4

    Create a worktree for a branch

    git gtr new my-feature

Things to know

  • Requires Bash 3.2+ and Git 2.17+; Windows support is through Git Bash only.
  • On Windows, the full checkout must stay in place because copying only bin/git-gtr breaks it.

In collections

Topics

FAQ

What is git-worktree-runner?
A Bash CLI that wraps git worktree to create, configure, and remove per-branch worktrees, with editor and AI agent launchers. gtr (Git Worktree Runner) is a command-line tool that makes git worktrees easier to use. A worktree lets you check out several branches of the same repository in separate folders at once, so you can work on a feature, review a pull request, or run tests on main without stashing changes or switching branches. gtr wraps the raw git worktree commands with shorter ones such as `git gtr new`, `git gtr pr 123`, and `git gtr rm`.
Is git-worktree-runner free to use? What license does it have?
git-worktree-runner is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is git-worktree-runner still maintained?
Actively maintained. The last commit to git-worktree-runner was on Nov 6, 2026.
What can I use git-worktree-runner for?
Reviewing a teammate's pull request without interrupting current feature work Running several AI coding agents in parallel, each on its own branch Keeping a clean worktree on main for running tests or builds Standardizing per-branch setup such as env files and dependency installs across a team
How do I install git-worktree-runner?
Install via Homebrew (macOS): brew tap coderabbitai/tap && brew install git-gtr Or clone the repository: git clone https://github.com/coderabbitai/git-worktree-runner.git Run the installer from the checkout: ./install.sh Create a worktree for a branch: git gtr new my-feature
Where can I get git-worktree-runner?
The source code and installation instructions are on GitHub: https://github.com/coderabbitai/git-worktree-runner

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects