Read branches sync.
Read a commit by branch name.
const masterCommit = await repo.readCommitByBranch('master');
const originMasterCommit = await repo.readCommitByBranch('origin/master');
Read a commit by branch name sync.
Read a commit by tag name.
const commit = repo.readCommitByTag('v1.0');
Read a commit by tag name sync.
Read a infomation of .git/HEAD
.
const head = repo.readHead();
// if type is 'branch'
console.log(head.type === 'branch');
console.log(head.branch);
// if type is 'commit'
console.log(head.type === 'commit);
console.log(head.branch);
Read a infomation of .git/HEAD
sync.
Read tags.
const tags = await repo.readTags();
Read tags sync.
Find a git directory. This function find one from current or parents directories.
Find a git directory sync. This function find one from current or parents directories.
Generated using TypeDoc
Read branches.
const heads = await repo.readBranches(); // or await repo.readBranches('heads'); const remotes = await repo.readBranches('remotes'); const allBranches = await repo.readBranches(['heads', 'remotes']); console.log(heads[0].name, heads[0].commit);