A command line tool to clone GitHub repositories by name or owner/name.
- Git (gits doesn't replace git)
- JSON.sh (included)
From the Terminal, follow these steps:
- Download from GitHub -
git clone https://github.com/srcoley/gits.git - Change directory to gits -
cd gits - Source the installation file -
. install.sh
See: What Does The Install File Do?
There are two ways to run gits:
gits <repo name>- This methos performs a search via theapi.github.com/legacy/repos/searchendpoint. Once the repo owner/name of the first result has been determined, it gets cached and gits gets ran again using the second method below.gits <repo owner>/<repo name>- This method clones directly fromhttps://github.com/<repo owner>/<repo name>.git, skipping the cache.
Two things:
- Moves gits' files to ~/.gits
- Adds
. ~/.gits/gits.shto the end of your .bash_profile file
Gits contains a cache file that keeps track of repo owner/name combinations for quicker cloning. By saving these combinations, the next time you run gits <repo name>, if anything in the cache matches <repo name>, gits will clone from GitHub without making a GET api search request.
- Add usage method
gits <repo name> allto display the top 5 results from a search. User should be able to begin cloning by selecting 1-5. - Update the
<repo owner>/<repo name>method to save combos to the cache file. - Better error handling.
- MIT
- Apache 2