gh-clone

git clone a repo with only username/repo.
Install
Install globally with npm
$ npm install -g gh-clone
CLI Usage
Let's say you want to clone micromatch:
$ gh-clone [owner/repo] <commands>
Examples
owner/repo
You can pass github owner name/repo:
$ gh-clone jonschlinkert/micromatch
repo
If you pass the repository name only, gh-clone will resolve the git url from the package.json hosted on npm.
$ gh-clone micromatch
flags
-r|--repo: the repository to clone
-b|--branch: the branch to clone
-d|--dest: the local destination
Example: branch
Flags can be used in any order. If you want the dev branch of micromatch (when one exists):
$ gh-clone jonschlinker/micromatch -b dev
Example: destination
If you want to save to the foo directory
$ gh-clone jonschlinker/micromatch -d foo
Example: branch and destination
If you want to save the dev branch to the foo directory
$ gh-clone jonschlinker/micromatch -b dev -d foo
API Usage
var clone = require('gh-clone');
Clone a repo with the given options:
Params
options {Object}: Options
repo {String}: Repository to clone.
branch {String}: Branch on repository to clone.
dest {String}: Destination folder to clone to.
cb {Function}: Callback
Example
clone({repo: 'jonschlinkert/micromatch'}, function(err) {
if (err) return console.error(err);
});
Normalizes options into a configuration object.
Params
options {Object}: Options
repo {String}: Repository to clone.
branch {String}: Branch on repository to clone.
dest {String}: Destination folder to clone to.
cb {Function}: Callback
Example
clone.normalize({repo: 'jonschlinkert/micromatch'}, function(err, config) {
if (err) return console.error(err);
console.log(config);
});
Related projects
You might also be interested in these projects:
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Running tests
Install dev dependencies:
$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert.
Released under the MIT license.
This file was generated by verb, v0.9.0, on June 18, 2016.