【问题标题】:How to use command 'git clone url' in nodejs server [closed]如何在nodejs服务器中使用命令'git clone url'[关闭]
【发布时间】:2016-01-06 02:42:35
【问题描述】:

我正在尝试在 NodeJs(服务器端)应用程序中克隆一个 git url。有没有人知道如何做到这一点。我想通过节点服务器 javascript 文件运行 git clone 命令。

【问题讨论】:

标签: javascript node.js git clone


【解决方案1】:

您可以尝试使用nodegit 插件:

https://github.com/nodegit/nodegit

示例(更多信息请参阅http://www.nodegit.org/api/):

var clone = require("nodegit").Clone.clone;

// Clone a given repository into a specific folder.
clone("https://github.com/nodegit/nodegit", "tmp")
  .then(function () {
    // Repo is available in "tmp"
  });

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-14
    • 1970-01-01
    • 1970-01-01
    • 2020-04-13
    • 2013-09-02
    • 1970-01-01
    • 1970-01-01
    • 2021-08-27
    相关资源
    最近更新 更多