gitr provides a way to organize remote repository clones, like go get does.
Based on motemen/ghq.
- Install bash-completion
- Install git
-
Copy gitr file into
bash_completion.ddirectory (under/sw/etcor$(brew --prefix)/etcon macOS w/ Homebrew). -
Add the following to your
~/.bash_profileor~/.profile
export GITR_ROOT=(~/.gitr)
gitr(){ cd "$(__gitr_dir "$1")" 2> /dev/null || __gitr_clone "$@"; }- Restart your shell
The path to directory under which cloned repositories are placed.
See Directory Structures below.
Defaults to ~/.gitr.
This variable can have multiple values. If so, the first one becomes primary one i.e. new repository clones are always created under it.
Local repositories are placed under GITR_ROOT with named github.com/user/repo.
~/.gitr
├── bitbucket.org
│ └── openscg
│ └── pgstudio
└── github.com
├── motemen
│ └── ghq
├── phalcon
│ └── zephir
└── ryuzi
└── oyster
Inspired by ghq in motemen.
gitr is released under an MIT-style license; see LICENSE for details.
