uga.dev - A Front-end Engineer's shed

The current theme is "Light mode".

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.

📁 Here’s how it works - zsh
$ pwd
/Users/admin
$ git cd
$ pwd
/Users/admin/repos/github.com/hiroya-uga/git-cd

The 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?

Getting Started

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

MethodNotes
cd + tab completionRequires knowing and typing the full repository path
find + cdVerbose command, tedious to repeat daily
fzf + findNeeds 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 (recommended)
git clone https://github.com/hiroya-uga/git-cd.git ~/.git-cd
~/.git-cd/install.sh
Quick install
curl -fsSL https://github.com/hiroya-uga/git-cd/releases/latest/download/install.sh | bash

What the installer does

  1. Places git-cd at ~/.local/bin/git-cd(clone install: symlink to the cloned script; curl install: downloads directly)
  2. Adds ~/.local/bin to PATH in ~/.zshrc (or ~/.bashrc)(only if not already present)
  3. 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 ~/works

Options

CommandDescription
--depth <n>Limit directory traversal depth (default: 5)
--nestedInclude nested repositories in the list (excluded by default)
--cacheUse the cached list as-is for faster startup (skips the fresh search)
-h, --helpShow help message

git cd ~/projects --depth 3