new Repo()
Convenience repository class.
- Source:
- repo.js, line 9
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:
- repo.js, line 46
-
commit(sha, callback)
-
Retrieve the commit identified by oid.
Parameters:
Name Type Description sha
String | Oid | git.raw.Oid callback
Repo~commitCallback - Source:
- repo.js, line 77
-
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:
- repo.js, line 97
-
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:
- repo.js, line 22
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:
- repo.js, line 47
-
commitCallback(error, commit)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. commit
Commit | null Commit represented by sha. - Source:
- repo.js, line 78
-
initCallback(error, repo)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. repo
Repo | null Initialized repository. - Source:
- repo.js, line 98
-
openCallback(error, repo)
-
Parameters:
Name Type Description error
GitError | null An Error or null if successful. repo
Repo | null Opened repository. - Source:
- repo.js, line 23