CLI tool to find git repositories.
Project description
A simple CLI tool for finding git repositories.
Installation
pip install git-find-repos
You may wish to install using pipx, which manages a virtual environment for git-find-repos for you.
Usage
git-find-repos will search recursively in the current directory for git repositories when invoked with no arguments:
git-find-repos
Alternatively, you can run git-find-repos as if it were a subcommand of git:
git find-repos
You can also pass a directory to search:
git find-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 git-find-repos to fzy for fuzzy matching.
function repo {
initial_query=$1
dest=$(git-find-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for git_find_repos-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 404db69eb0e63bb0f1e233db0b1c46b3984c7d6c8b52a1f9aa0b03e8d754358f |
|
MD5 | 122c5f6e276b09d5381d975cbd87b536 |
|
BLAKE2b-256 | 049883cbc0790081edc47cbe8aae19724fa8160d92e3d769e48bd52661d79170 |