Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
deps
spec
src
.gitignore
.gitmodules
.npmignore
.travis.yml
Gruntfile.coffee
README.md
binding.gyp
build-libgit2.sh
package.json

README.md

Git Node module Build Status

Helpers for working with Git repositories built natively on top of libgit2.

Installing

npm install git-utils

Building

  • Clone the repository
  • Run npm install
  • Run grunt to compile the native and CoffeeScript code

Documentation

git.open(path)

Open the repository at the given path. This will return null if the repository at the given path does not exist or cannot be opened.

git = require 'git-utils'

repository = git.open('/Users/me/repos/node')

Repository.checkoutHead(path)

Repository.getAheadBehindCount()

Repository.getCommitCount(fromCommit, toCommit)

Repository.getConfigValue(key)

Repository.getDiffStats(path)

Repository.getHead()

Repository.getLineDiffs(path, text)

Repository.getMergeBase(commit1, commit2)

Repository.getPath()

Repository.getReferenceTarget(ref)

Repository.getShortHead()

Repository.getStatus([path])

Repository.getUpstreamBranch([branch])

Repository.getWorkingDirectory()

Repository.isIgnored(path)

Repository.isPathModified(path)

Repository.isPathNew(path)

Repository.isStatusModified(status)

Repository.isStatusNew(status)

Repository.isSubmodule(path)

Repository.refreshIndex()

Repository.release()

Something went wrong with that request. Please try again.