A Git extension for navigating repos and worktrees. Built for developers juggling many worktrees across multiple repos.
Copy a branch name from a PR, run jbr feat/my-branch, and you're cd'd into the right worktree — no matter which repo it lives in or which terminal you're in.
git where makes it easy to jump to:
- Branch checkout —
git where checkout <branch>finds which repo owns a branch and jumps to its worktree (or creates one with--create). - File in a repo —
git where path <query>resolves a tracked filename to an absolute path, ranked by frecency. - Directory in a repo —
git where dir <query>does the same for directories. - Repo by name —
git where repo <query>finds a tracked repo by its directory name.
When a query is ambiguous, fzf opens for interactive selection. When it's unique, the answer prints immediately.
gitonPATHfzfonPATH(for interactive selection when multiple matches exist)
Homebrew (macOS):
brew install turadg/tap/git-whereCargo:
cargo install git-whereFrom source:
cargo install --path .Git automatically discovers git-where as git where (no registration needed — git searches PATH for git-<subcommand> executables).
Note: Use
git where helpfor help (not--help). Git intercepts--helpon extensions and tries to open a man page, which we don't ship.helpis a subcommand that git passes through.
# Track the repos you work in
cd ~/Code/some-monorepo && git where --add-repo
git where --add-repo /path/to/another-repo
# Add to ~/.zshrc or ~/.bashrc
eval "$(git where env)"This defines shell functions (jp, jd, jr, jbr) that call git where, capture the path, and cd into it.
Copy a branch name from a PR page, paste it here, and you're in the right worktree.
- Searches your tracked repos for one that has the branch (locally or in remote-tracking refs).
- If exactly one repo has it: that's the answer.
- If multiple have it:
fzfasks which. - If none have it:
fzfasks which repo to fetch in, then runsgit fetch origin <branch>. Errors if the branch doesn't exist onorigin. - Checks
git worktree listfor an existing worktree on that branch — if found, prints its path. - With
--create: creates a worktree at the path determined bywhere.worktree-pathusing the command fromwhere.worktree-command. Without--create: prints a hint and exits.
Searches files tracked by git ls-files in the current repo. Matches against the filename only (not the full path). Results are ranked by frecency.
Same as path, but searches unique parent directories of tracked files. With no query, prints the repo root.
Searches your tracked repos by directory name. Matches against the last path component (e.g., monorepo matches /Users/you/Code/monorepo). If exactly one matches, prints its path. If multiple match, opens fzf. No query opens fzf over all tracked repos.
Adds a repo to the tracked list. Defaults to the current repo if no path is given. Idempotent.
Removes a repo from the tracked list. Defaults to the current repo.
Prints tracked repo paths, one per line.
All configuration lives in git config --global under the where.* section.
List of absolute repo paths to search when running checkout.
git config --global --add where.repo /Users/you/Code/monorepo
git config --global --get-all where.repo # list
git config --global --unset where.repo /path # removeTemplate for computing the worktree directory. Available variables:
| Variable | Value |
|---|---|
{repo_path} |
Absolute path to the repo root |
{repo} |
Repo directory name |
{branch} |
Raw branch name |
{branch_sanitized} |
Branch with / and \ replaced by - |
Default: {repo_path}/../{repo}.{branch_sanitized} (worktrunk sibling convention)
Example — nested worktrees directory:
git config --global where.worktree-path '{repo_path}.worktrees/{branch_sanitized}'
# Produces: ~/Code/myrepo.worktrees/feat-loginTemplate for the command that creates the worktree. Split on whitespace into argv (no shell layer — safe from injection). Available variables:
| Variable | Value |
|---|---|
{path} |
Rendered worktree path (from where.worktree-path) |
{branch} |
Raw branch name |
{repo} |
Absolute repo root path |
Default: git worktree add {path} {branch}
Example — use worktrunk:
git config --global where.worktree-command 'wt add {branch}'| Purpose | Path |
|---|---|
| Frecency state | $XDG_STATE_HOME/git-where/history.json (default ~/.local/state/git-where/history.json) |
| Config | Standard git config --global (~/.gitconfig) |
