0.2.0 ā¢ Published 6 years ago
git-cd v0.2.0
git-cd
š· cd dir after git clone if not exist
Installation
$ npm i git-cd -g
Usage
$ git-cd <repoUrl>
Set up BASE
directory:
$ git config --global ghq.root THE_PATH_YOU_WANT
By default, the repository is cloned via SSH protocol. Or you can pass --inherit-url
flag to disable it.
Required
motemen/ghq: Remote repository management made easy
go get github.com/motemen/ghq
How it works
- Clone a remote repository under the BASE directory. Just like
git clone
. - Run hook if exists. (Optional)
- Change current directory to cloned repository with the shell.
Hook
Put file in ~/.git-cd/hook.js
, and write anything in nodo.js.
Example:
$ mkdir -p ~/.git-cd
$ echo "console.log('hook receives:', process.argv[2])" > ~/.git-cd/hook.js
Directory Structures
$BASE
āāā github.com
āĀ Ā āāā foo
āĀ Ā āāā bar
āāā gitlab.com
āāā foo
āāā bar