Fork me on GitHub
nodegit by tbranyen & faceleg

Repo

new Repo()

Convenience repository class.
Source:

Methods

branch(name, callback)

Look up a branch's most recent commit.
Parameters:
Name Type Description
name String Branch name, e.g. 'master'
callback Repo~branchCallback
Source:

commit(sha, callback)

Retrieve the commit identified by oid.
Parameters:
Name Type Description
sha String | Oid | git.raw.Oid
callback Repo~commitCallback
Source:

init(directory, isBare, callback)

Initialise a git repository at directory.
Parameters:
Name Type Description
directory String
isBare Boolean True if the repository is to be bare, false otherwise.
callback Repo~initCallback
Source:

open(directory, callback)

Open the git repository at directory.
Parameters:
Name Type Description
directory String The .git directory for the repository to open.
callback Repo~openCallback
Source:
Example
git.repo('/path/to/repository/.git', function(error, repo) { });

Type Definitions

branchCallback(error, repo)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
repo Commit | null HEAD commit for the branch.
Source:

commitCallback(error, commit)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
commit Commit | null Commit represented by sha.
Source:

initCallback(error, repo)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
repo Repo | null Initialized repository.
Source:

openCallback(error, repo)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
repo Repo | null Opened repository.
Source: