A git ref (tag, branch, or commit).
Summary
Functions
Return this ref's repository with HEAD pinned to the selected commit.
Creates a synthetic workspace from this git ref.
The resolved commit id at this ref.
The resolved commit SHA at this ref.
Find the best common ancestor between this ref and another ref.
Return true when the other ref's commit equals this commit or is an ancestor of it.
A unique identifier for this GitRef.
Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
The resolved name of this ref.
Push this ref's commit and history to a remote repository using the destination's credentials.
The resolved ref name at this ref.
The commit this ref resolves to.
The filesystem tree at this ref.
Create a single-parent commit on this ref by applying a changeset's edits.
Types
Functions
@spec as_repository(t()) :: Dagger.GitRepository.t()
Return this ref's repository with HEAD pinned to the selected commit.
Preserves the original repository backend, connection information, and other refs. Does not modify a branch or checkout, or prune history.
@spec as_workspace(t(), [{:cwd, String.t() | nil}]) :: Dagger.Workspace.t()
Creates a synthetic workspace from this git ref.
The resolved commit id at this ref.
The resolved commit SHA at this ref.
Find the best common ancestor between this ref and another ref.
Return true when the other ref's commit equals this commit or is an ancestor of it.
Compares commit history across branches, tags and detached refs. Incomplete or unavailable history is an error.
A unique identifier for this GitRef.
@spec log(t(), limit: integer() | nil, paths: [String.t()], base: t() | nil) :: {:ok, [Dagger.GitCommit.t()]} | {:error, term()}
Commits reachable from this ref, newest first, starting with the commit this ref resolves to.
The resolved name of this ref.
@spec push(t(), to: Dagger.GitRepository.t() | nil, remote: String.t() | nil, branch: String.t() | nil, expected_remote_sha: String.t() | nil ) :: Dagger.GitPushResult.t()
Push this ref's commit and history to a remote repository using the destination's credentials.
The source can come from a remote repository or an engine-side Git repository. To publish a workspace's commits, use Workspace.git.head.push. Pushing does not modify the calling client's checkout, and checkout hooks do not run.
A missing remote ref is created. Without a lease, Git's normal non-force rules apply. Each invocation performs a push; loading the returned receipt does not push again.
The resolved ref name at this ref.
@spec target_commit(t()) :: Dagger.GitCommit.t()
The commit this ref resolves to.
@spec tree(t(), discard_git_dir: boolean() | nil, depth: integer() | nil, include_tags: boolean() | nil ) :: Dagger.Directory.t()
The filesystem tree at this ref.
@spec with_commit( t(), Dagger.Changeset.t(), String.t(), String.t(), String.t(), String.t(), committer_name: String.t() | nil, committer_email: String.t() | nil, committer_date: String.t() | nil, allow_empty: boolean() | nil, signoff: boolean() | nil ) :: t()
Create a single-parent commit on this ref by applying a changeset's edits.
Three-way merges the changeset against this ref's tree, using its before snapshot as the base. Preserves compatible parent edits and fails on conflicts. Does not modify the input repository or host checkout.
Identity and dates are explicit; neither client Git configuration nor the current clock is consulted.