git-cdJump across local repositories with a single command
A CLI extension that lets you search local repositories and jump to any working directory with git cd. Speeds up switching between multiple projects.
$ pwd
/Users/admin
$ git cd
$ pwd
/Users/admin/repos/github.com/hiroya-uga/git-cdThe git cd command searches local repositories on your computer and moves you to the selected repository directory. A CLI extension for developers working across multiple projects.
Why git cd?
When managing multiple repositories, navigating with cd requires remembering and typing full paths. Tab completion also struggles with deeply nested directories or similarly-named projects.
git cd automatically scans all local repositories and lets you jump to any of them instantly. With fzf installed, you get incremental fuzzy search; without it, a numbered list is shown instead.
How it compares
| Method | Notes |
|---|---|
| cd + tab completion | Requires knowing and typing the full repository path |
| find + cd | Verbose command, tedious to repeat daily |
| fzf + find | Needs custom setup and configuration, no git integration |
| git cd (this tool) | Works as a git subcommand out of the box, no extra setup needed |
Who it's for
- Developers who work across multiple repositories daily
- Those managing multiple independent repositories (monorepo users can include nested repos with --nested)
- Terminal-first developers who want faster project switching
Getting Started
You can choose either the git clone version or the quick install version.
git clone https://github.com/hiroya-uga/git-cd.git ~/.git-cd
~/.git-cd/install.shcurl -fsSL https://github.com/hiroya-uga/git-cd/releases/latest/download/install.sh | bashWhat the installer does
- Places
git-cdat~/.local/bin/git-cd(clone install: symlink to the cloned script; curl install: downloads directly) - Adds
~/.local/bintoPATHin~/.zshrc(or~/.bashrc)(only if not already present) - Appends a shell function to
~/.zshrc(or~/.bashrc)
※After installation, restart your terminal.
Usage
git cd # Search repositories under your home directory
git cd ~/projects # Search from a specific directory※If fzf (a fuzzy finder CLI) is installed, you can filter and select repositories by typing keywords. Otherwise, a numbered list is shown.
Configuration
You can set a default search root in git's global config. If you pass a path as an argument, that path takes precedence.
git config --global git-cd.root ~/worksOptions
| Command | Description |
|---|---|
--depth <n> | Limit directory traversal depth (default: 5) |
--nested | Include nested repositories in the list (excluded by default) |
--cache | Use the cached list as-is for faster startup (skips the fresh search) |
-h, --help | Show help message |
git cd ~/projects --depth 3