Syntax
Description
Therepo 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
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/repoexpand togithub.com/user/repo
Examples
Navigate to a repository
$REPO_BASE_DIR/github.com/torvalds/linux/main/ (or the default branch).
Navigate with full path
Navigate to GitLab repository
Behavior
Single Worktree
If the repository has only one worktree (the default branch), you are automatically taken there:Multiple Worktrees (with fzf)
If the repository has multiple worktrees andfzf is installed, an interactive selector appears:
Multiple Worktrees (without fzf)
Iffzf is not available, the command defaults to the default branch worktree:
Standard Git Layout
For repositories using standard Git layout (not converted to worktree layout), the command navigates to the repository root:Repository Not Found
If the repository doesn’t exist:repo get.
Related Commands
- 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
go alias for faster typing.
Switch between projects
Work with different branches
Tips
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:
- Cleans and normalizes the repository path
- Checks if the repository exists
- Detects if it uses worktree layout (
.baredirectory) - Lists all worktrees using
git worktree list --porcelain - Presents worktrees for selection if multiple exist and
fzfis available - Navigates to the selected worktree via the
post_repo_gotohook