Skip to main content

CLI tool to find git repositories.

Project description

A simple CLI tool for finding git repositories.

Installation

pip install find-git-repos

You may wish to install using pipx, which manages a virtual environment for find-git-packages for you.

Usage

find-git-repos will search recursively in the current directory for git repositories when invoked with no arguments:

find-git-repos

Alternatively, you can pass a directory to search:

find-git-repos ~/src

I created this tool to aid navigating between repositories on my computer. I organise respostories in subdirectories corresponding to their HTTPS/SSH URLs on GitHub, Bitbucket and GitLab, e.g.:

  • ~/src/github.com/acroz/pylivy
  • ~/src/bitbucket.org/acroz/other-repo
  • ~/src/gitlab.com/organisation/group/subgroup/repo

To facilitate switching between repos quickly, I define a zsh function in my .zshrc shell configuration file that pipes the output of find-git-repos to fzy for fuzzy matching.

function repo {
    initial_query=$1
    dest=$(find-git-repos ~/src | fzy -q "$initial_query" -l 20) && cd "$HOME/src/$dest"
}

When I need to switch to a repo, I run repo in my shell, type enough of the name to match the repo name, then hit enter to exit fzy and switch to the selected repo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for find-git-repos, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size find_git_repos-1.1.0-py3-none-any.whl (3.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size find-git-repos-1.1.0.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page