git-clone(1) repositories into a pre-determined directory structure.
Using the -n
flag for demonstration:
% clone -n [email protected]:user/repository
git clone [email protected]:/user/repository /home/user/src/github.com/user/repository
or
% pwd
/home/user/src/github.com/user
% clone -n another-repository
git clone [email protected]:/user/another-repository /home/user/src/github.com/user/antother-repository
It is recommended to set the CDPATH
environment variable to the different
hosts you have repositories from. This allows for quick access and quick cloning
due to the known directory structure of clone(1).
% CDPATH=$HOME/src/github.com
% cd user
~/src/github.com/user
% clone -n repository
git clone [email protected]:/user/repository /home/user/src/github.com/user/repository
# make install
% nix-env -i -f .
% man clone