npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-batch-clone

v0.1.1

Published

This is a cmd tool, that helps you to clone and config multiple git repos into a specified folder structure.

Readme

git-batch-clone

批量克隆或更新git仓库

安装 Installation

Note: 如果需要使用 git-batch-clone 的命令行工具,请全局安装。

  $ [sudo] npm install git-batch-clone -g

Note: 如果需要使用 git-batch-clone 开发你的程序请按如下方式安装

  $ cd /path/to/your/project
  $ [sudo] npm install git-batch-clone -g

用法 Usage

有两种方式使用 git-batch-clone,通过命令行或者在你的代码中引入。

命令行用法 Command Line Usage

你可以在你的工作目录(有git仓库配置文件 configfile.json 的目录),运行 git-batch-clone 批量克隆或更新git仓库。

Example

  $ cd /path/to/your/workspace
  $ git-batch

Options

  $ git-batch --help

  Usage: git-batch [options]

  start clone and config git repos

  Options:

    -h, --help            output usage information
    -V, --version         output the version number
    -c, --config [value]  the configfile

JSON 配置文件 JSON Configuration File

git仓库的JSON配置文件要按如下格式编写,默认文件名为configfile.json。如果使用其他名字,可以使用 -c other_configfile.json 来指定。

{
  "global": {
    "host": "ssh://host.your-git-resource.com/",
    "config": {
      "user.name": "your name",
      "user.email": "your email",
      ...
    },
    "branch": {
      "local": "develop",
      "remote": "origin/develop"
    }
  },
  "repos": [{
    "repo": "project0"
  }, {
    "repo": "project1",
    "mapping": "project_one",
  }, {
    "host":"https://git.other.com/",
    "repo":"project2",
    "mapping":"other_repos/project2",
    "branch":{
      "local":"master",
      "remote":"origin"
    },
    "config": {
      "user.name": "your other name"
    }
  }, {
    "host":"https://github.com/",
    "repo":"your_github_name/your_github_repo",
    "mapping":"github/your_github_repo",
    "branch":{
      "local":"master",
      "remote":"origin"
    },
    "config": {
      "user.name": "your github name",
      "user.email": "your github email"
    }
  }]
}
global:全局配置
  host:git仓库的host
  config:git config配置项(key:value)
  branch:默认git分支
    local:本地分支名称
    remote:远程分支名称
repos:repo的自定义配置
  repo:git仓库名称
  mapping:本地路径(非必填)
  其他参数同全局配置,每个repo都会继承global的配置,如果配置了,会覆盖全局配置对应项。

Note 克隆和更新使用同样的命令即可,git-batch-clone 会自动检测目录下所有git仓库的状态进行相应的处理。

在你的代码中引用 Using In Your Code

除了命令行的方式,git-batch-clone 还支持在你的代码中引入的方式,方便你开发自己的代码。


  import gitBatch from "git-batch-clone"

  gitBatch(dirname, configs).then(function(){
    console.log('success');
  });
  dirname: 需要执行git批量操作的目录
  configs: git repos配置json,结构同上面的 configfile.json