Skip to main content

GitRepository

The GitRepository type represents a Git repository.

API reference

A git repository.

Implements Node

branches
branches that match any of the given glob patterns.
id
A unique identifier for this GitRepository.
tags
tags that match any of the given glob patterns.
url
The URL of the git repository.
asWorkspace
Creates a synthetic workspace from this git repository.
branch
Returns details of a branch.
commit
Returns details of a commit.
head
Returns details for HEAD.
latestVersion
Returns details for the latest semver tag.
ref
Returns details of a ref.
tag
Returns details of a tag.
uncommitted
Returns the changeset of uncommitted changes in the git repository.

branches(patterns: [String!]): [String!]!

branches that match any of the given glob patterns.

patterns: [String!]

Glob patterns (e.g., "refs/tags/v*").

id: ID!

A unique identifier for this GitRepository.

tags(patterns: [String!]): [String!]!

tags that match any of the given glob patterns.

patterns: [String!]

Glob patterns (e.g., "refs/tags/v*").

url: String

The URL of the git repository.

asWorkspace(cwd: String = "/"): Workspace!Experimental

Creates a synthetic workspace from this git repository.

Experimental: Synthetic workspaces currently support filesystem APIs only.

cwd: String = "/"

Current working directory inside the workspace root. Defaults to the workspace root.

branch(name: String!): GitRef!

Returns details of a branch.

name: String!

Branch's name (e.g., "main").

commit(id: String!): GitRef!

Returns details of a commit.

id: String!

Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").

Returns details for HEAD.

latestVersion: GitRef!

Returns details for the latest semver tag.

ref(name: String!): GitRef!

Returns details of a ref.

name: String!

Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).

tag(name: String!): GitRef!

Returns details of a tag.

name: String!

Tag's name (e.g., "v0.3.9").

uncommitted: Changeset!

Returns the changeset of uncommitted changes in the git repository.

References

Returned by

Accepted as an argument by