Class: GitRepository
A git repository.
Extends​
BaseClient
Constructors​
Constructor​
new GitRepository(
ctx?,_id?,_url?):GitRepository
Constructor is used for internal usage only, do not create object from it.
Parameters​
ctx?​
Context
_id?​
_url?​
string
Returns​
GitRepository
Overrides​
BaseClient.constructor
Methods​
branch()​
branch(
name):GitRef
Returns details of a branch.
Parameters​
name​
string
Branch's name (e.g., "main").
Returns​
branches()​
branches(
opts?):Promise<string[]>
branches that match any of the given glob patterns.
Parameters​
opts?​
Returns​
Promise<string[]>
commit()​
commit(
id):GitRef
Returns details of a commit.
Parameters​
id​
string
Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
Returns​
head()​
head():
GitRef
Returns details for HEAD.
Returns​
id()​
id():
Promise<GitRepositoryID>
A unique identifier for this GitRepository.
Returns​
Promise<GitRepositoryID>
latestVersion()​
latestVersion():
GitRef
Returns details for the latest semver tag.
Returns​
ref()​
ref(
name):GitRef
Returns details of a ref.
Parameters​
name​
string
Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
Returns​
tag()​
tag(
name):GitRef
Returns details of a tag.
Parameters​
name​
string
Tag's name (e.g., "v0.3.9").
Returns​
tags()​
tags(
opts?):Promise<string[]>
tags that match any of the given glob patterns.
Parameters​
opts?​
Returns​
Promise<string[]>
uncommitted()​
uncommitted():
Changeset
Returns the changeset of uncommitted changes in the git repository.
Returns​
url()​
url():
Promise<string>
The URL of the git repository.
Returns​
Promise<string>