Node bindings to the libgit2 project.
| Linux | OS X | Windows | Coverage | Dependencies |
|---|---|---|---|---|
|
|
|
|
|
|
Stable (libgit2#master): 0.19.0 Stable ([email protected]): 0.14.1
Visit slack.libgit2.org to sign up, then join us in #nodegit.
Tim Branyen @tbranyen, John Haley @johnhaley81, and Max Korp @maxkorp with help from tons of awesome contributors!
Steve Smith @orderedlist, Michael Robinson @codeofinterest, and Nick Kallen @nk
NodeGit will work on most systems out-of-the-box without any native dependencies.
npm install nodegitIf you receive errors about libstdc++, which are commonly experienced when building on Travis-CI, you can fix this by upgrading to the latest libstdc++-4.9.
In Ubuntu:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libstdc++-4.9-devIn Travis:
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++-4.9-devIn CircleCI:
dependencies:
pre:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install -y libstdc++-4.9-devIf you receive errors about lifecycleScripts preinstall/install you probably miss libssl-dev In Ubuntu:
sudo apt-get install libssl-dev
If you are still encountering problems while installing, you should try the Building from source instructions.
var Git = require("nodegit");
// Clone a given repository into the `./tmp` folder.
Git.Clone("https://github.com/nodegit/nodegit", "./tmp")
// Look up this known commit.
.then(function(repo) {
// Use a known commit sha from this repository.
return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5");
})
// Look up a specific file within that commit.
.then(function(commit) {
return commit.getEntry("README.md");
})
// Get the blob contents from the file.
.then(