Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has anyone implemented a git clone or interface library using nodejs? [closed]

Tags:

git

node.js

I'm looking for an implementation of git which is accessible from nodejs - does such a beast exist?

like image 503
blueberryfields Avatar asked May 10 '11 20:05

blueberryfields


People also ask

How do I clone a Git repository node JS?

Clone a Repository var Git = require("nodegit"); Git. Clone("https://github.com/nodegit/nodegit", "nodegit"). then(function(repository) { // Work with the repository object here. }); This will clone our repository into a folder named nodegit .

Can you run node js on github?

And node. js app is a server-based website, we can't host it on Github.

Does node js need Git?

Node. js and Git may be necessary to pull and build packages from the NPM, run tasks and many more great features, but just to learn Angular all you need is its code.

What is node Git?

A custom Git command for managing pull requests. You can run it as git-node or git node .


2 Answers

Looks like there are now several options for using git from node:

  • gift: simple Node.js wrapper for the Git CLI with an API based on Grit (npm / github)
  • node-git: a node.js git implementation modeled on grit (npm / github)
  • nodegit: libgit2 asynchronous native bindings (npm / github)
  • node-git: a thin wrapper around the command-line git command (github)
like image 161
dribnet Avatar answered Oct 01 '22 10:10

dribnet


Note sure if there's a git library for Node but you can also just execute a shell process directly, example:

var sys = require('sys') var exec = require('child_process').exec; function puts(error, stdout, stderr) { sys.puts(stdout) } exec("git status", puts); 
like image 25
Mauvis Ledford Avatar answered Oct 01 '22 12:10

Mauvis Ledford