Skip to main content

Syntax

repo goto <repository-path>
repo go <repository-path>    # Alias

Description

The repo goto command navigates to a repository in your $REPO_BASE_DIR. For repositories with multiple worktrees, it presents an interactive selector (using fzf if available) to choose which worktree to enter.

Arguments

repository-path
string
required
The repository path relative to $REPO_BASE_DIR. The path is cleaned and normalized:
  • Protocol prefixes are removed (https://, git@, etc.)
  • Colons are converted to slashes
  • Short paths like user/repo expand to github.com/user/repo

Examples

repo goto torvalds/linux
Navigates to $REPO_BASE_DIR/github.com/torvalds/linux/main/ (or the default branch).
repo goto github.com/user/project
repo goto gitlab.com/gitlab-org/gitlab

Behavior

Single Worktree

If the repository has only one worktree (the default branch), you are automatically taken there:
repo goto user/repo
# → cd $REPO_BASE_DIR/github.com/user/repo/main

Multiple Worktrees (with fzf)

If the repository has multiple worktrees and fzf is installed, an interactive selector appears:
repo goto user/repo
> Select worktree:
  main
  feature-1
  bugfix-2
  experiment
Use arrow keys to select and press Enter.

Multiple Worktrees (without fzf)

If fzf is not available, the command defaults to the default branch worktree:
repo goto user/repo
# → cd $REPO_BASE_DIR/github.com/user/repo/main

Standard Git Layout

For repositories using standard Git layout (not converted to worktree layout), the command navigates to the repository root:
repo goto old-repo
# → cd $REPO_BASE_DIR/github.com/user/old-repo

Repository Not Found

If the repository doesn’t exist:
Error: Repository not found: /path/to/repo
You may need to clone it first with repo get.
  • repo get - Clone a repository before navigating to it
  • repo list - List all available repositories
  • repo wt go - Navigate between worktrees within the current repository

Common Use Cases

Quick navigation

repo go user/repo
Use the shorter go alias for faster typing.

Switch between projects

repo goto project-a
# Work on project-a
repo goto project-b
# Work on project-b

Work with different branches

repo goto user/repo
# Select "feature-branch" from fzf
# → cd $REPO_BASE_DIR/github.com/user/repo/feature-branch

Tips

Install fzf to enable interactive worktree selection:
# Ubuntu/Debian
sudo apt install fzf

# macOS
brew install fzf

# Arch Linux
sudo pacman -S fzf
The command skips worktrees that are not subdirectories of the repository root, ensuring you only see relevant worktrees for selection.

Implementation Details

Source code: functions/goto.zsh:1 The command:
  1. Cleans and normalizes the repository path
  2. Checks if the repository exists
  3. Detects if it uses worktree layout (.bare directory)
  4. Lists all worktrees using git worktree list --porcelain
  5. Presents worktrees for selection if multiple exist and fzf is available
  6. Navigates to the selected worktree via the post_repo_goto hook

Build docs developers (and LLMs) love