Skip to content

A command line tool to jump between repositories with ease

License

Notifications You must be signed in to change notification settings

mohitsinghs/repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repo

Switch between repositories with ease
Access all repositories from anywhere

Release LICENSE


Features

  • Fast - takes under 60ms to scan list my all repositories.
  • Fuzzy matching - can match paths partially.
  • Shell integration - Works with zsh and bash.
  • Output formats - supports plain and nested json output.
  • Respects gitignore - skips nested repositories that are ignored by git.
  • Configurable - you can add multiple roots and control scan depth for each.

Demo

repo

Installing

Download latest release for your system and put it in the path.

Shell integration

You can also run repo sh to see the setup instructions for your current shell if supported.

For zsh

Put following in you ~/.zshrc. The default binding is z but you can change it.

eval $(repo sh zsh)

Or if you prefer x or some other letter, use that

eval $(repo sh zsh -b x)

For bash

Put following in you ~/.bashrc or ~/.bash_profile. The default binding is z but you can change it.

eval $(repo sh bash)

Or if you prefer x or some other letter, use that

eval $(repo sh bash -b x)

Usage

You can jump around your repos with -

% z fo/ba
% /foo/bar
% z p/os/vsc
% ~/Projects/oss/vscode-repo

Where z can be any letter you bind. Hitting the tab will show you possible locations.

Editor Integration

Configuration

You can customize the behavior of repo by creating a configuration file named repo.yml.

Tip

If no repo.yml file exists, the tool will search your home directory by default.

1. Initializing Config

To initiate a blank configuration file, execute the following command:

repo init

This creates the repo.yml file in your system's default configuration directory.

2. Specifying Root Paths

Warning

Ensure paths are specified using the correct path syntax for your operating system.

Define the directories you wish to include in the search. Each path can optionally specify a maximum traversal depth:

roots:
  # Search all Git repositories within this directory:
  - path: /home/mohit/Projects

  # Restrict the search to a depth of 2 levels within this directory:
  - path: /home/mohit/Work
    depth: 2