You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retrieves repo information without relying on the git command.
Usage
vargetRepoInfo=require('git-repo-info');varinfo=getRepoInfo();info.branch// current branchinfo.sha// current shainfo.abbreviatedSha// first 10 chars of the current shainfo.tag// tag for the current sha (or `null` if no tag exists)info.lastTag// tag for the closest tagged ancestor// (or `null` if no ancestor is tagged)info.commitsSinceLastTag// number of commits since the closest tagged ancestor// (`0` if this commit is tagged, or `Infinity` if no ancestor is tagged)info.committer// committer for the current shainfo.committerDate// commit date for the current shainfo.author// author for the current shainfo.authorDate// authored date for the current shainfo.commitMessage// commit message for the current shainfo.root// root directory for the Git repo or submodule// (if in a worktree, this is the directory containing the original copy)info.commonGitDir// directory containing Git metadata for this repo or submodule// (if in a worktree, this is the primary Git directory for the repo)info.worktreeGitDir// if in a worktree, the directory containing Git metadata specific to// this worktree; otherwise, this is the same as `commonGitDir`.
When called without any arguments, git-repo-info will automatically lookup upwards
into parent directories to find the first match with a .git folder.
If passed an argument, it will be assumed to be the path to the repo's .git folder
to inspect.