🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

gh-clone

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-clone

git clone a repo with only username/repo, or if it's an NPM package you can use just the name of the project.

Source
npmnpm
Version
0.5.0
Version published
Weekly downloads
123
108.47%
Maintainers
2
Weekly downloads
 
Created
Source

gh-clone NPM version NPM downloads Build Status

git clone a repo with only username/repo, or if it's an NPM package you can use just the name of the project.

Install

Install globally with npm

$ npm install --global gh-clone

CLI Usage

Clone a github repository:

$ gh-clone [owner/repo] <commands>

Examples

owner/repo

Pass the github repository formatted as owner/repo:

$ gh-clone jonschlinkert/micromatch

repo only

If the it's an NPM package, you can pass the repository name only, and gh-clone will resolve the git url from the lib's package.json:

$ gh-clone generate

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

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);
});

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)

To generate the readme and API documentation with verb:

$ npm install -g verb verb-generate-readme && 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 July 23, 2016.

Keywords

clone

FAQs

Package last updated on 23 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts