git-cd

0.2.0Β β€’Β PublicΒ β€’Β Published

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

Package Sidebar

Install

npm i git-cd

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

4.64 kB

Total Files

5

Last publish

Collaborators

  • viko16