Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acroz/git-find-repos
A simple CLI tool for finding git repositories.
https://github.com/acroz/git-find-repos
Last synced: 10 days ago
JSON representation
A simple CLI tool for finding git repositories.
- Host: GitHub
- URL: https://github.com/acroz/git-find-repos
- Owner: acroz
- License: mit
- Created: 2020-07-04T12:37:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T11:45:44.000Z (over 1 year ago)
- Last Synced: 2024-10-07T10:10:08.753Z (about 1 month ago)
- Language: Python
- Size: 11.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
git-find-repos
==============A simple CLI tool for finding git repositories.
Installation
------------.. code-block:: sh
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:.. code-block:: sh
git-find-repos
Alternatively, you can run ``git-find-repos`` as if it were a subcommand of
``git``:.. code-block:: sh
git find-repos
You can also pass a directory to search:
.. code-block:: sh
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/repoTo 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... code-block:: zsh
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.Related projects
----------------@robgyiv has reimplemented this tool in Rust - check it out
`on GitHub `_.