get-git-repository

1.0.6 • Public • Published

download git repo

down a git repository, support github, gitlab, bitbucket, gitee(码云)

Installation

$ npm install get-git-repository

or:

$ yarn add get-git-repository

Usage

  const download = require('get-git-repository')
  // owner/repository  => download from github
  // github:owner/repository  => download from github
  // gitlab:owner/repository  => download from gitlab
  // gitee:owner/repository  => download from gitee
  // bitbucket:owner/repository  => download from bitbucket
  const repo = '/huoqishi/x-html'
  download(repo, 'test/').then(() => {
    console.log('ok')
  })

API

download

download(repo, savePath, [options])

clone repo to savePath, return promise on completion.

options

  • clone: default false, If true use git clone instead of an http download。

    if download from gitee(码云), api will auto set clone = true。

  • shallow: when true, clone with depth 1 (optional).

  • checkout: revision/branch/tag to check out (optional).

Copyright & License

© huoqishi & 火骑士空空

Released under the MIT.

目前问题: 没有删除.git文件夹

Package Sidebar

Install

npm i get-git-repository

Weekly Downloads

6

Version

1.0.6

License

ISC

Unpacked Size

5.42 kB

Total Files

3

Last publish

Collaborators

  • huoqishi