0.2.0 ā€¢ Published 6 years ago

git-cd v0.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

git-cd

Build Status NPM version JavaScript Style Guide

šŸ‘· 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

  1. Clone a remote repository under the BASE directory. Just like git clone.
  2. Run hook if exists. (Optional)
  3. 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

License

MIT License Ā© viko16

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago