Dagger
Search

git

This module has been generated via dagger init and serves as a reference to
basic module structure as you get started with Dagger.

Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.

The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.

Installation

dagger install github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c

Entrypoint

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Git repository directory (must include .git)
imageRegistryString "docker.io"Git image registry
imageRepositoryString "alpine/git"Git image repositroy
imageTagString "2.52.0"Git image tag
userIdString "65532"Git image user
Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
func (m *MyModule) Example() *dagger.Git  {
	return dag.
			Git()
}
@function
def example() -> dagger.Git:
	return (
		dag.git()
	)
@func()
example(): Git {
	return dag
		.git()
}

Types

Git 🔗

container() 🔗

Creates container with configured git

Return Type
Container !
Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 container
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Git().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.git()
		.container()
	)
@func()
example(): Container {
	return dag
		.git()
		.container()
}

createTag() 🔗

Create a local lightweight or annotated tag.

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
tagString !-

Tag name to create

messageString null

Optional annotated tag message

userNameString !"dagger-ci"

Tagger name for annotated tags

userEmailString !"dagger-ci@example.local"

Tagger email for annotated tags

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 create-tag --tag string --user-name string --user-email string
func (m *MyModule) Example(tag string, userName string, userEmail string) *dagger.Git  {
	return dag.
			Git().
			CreateTag(tag, userName, userEmail)
}
@function
def example(tag: str, user_name: str, user_email: str) -> dagger.Git:
	return (
		dag.git()
		.create_tag(tag, user_name, user_email)
	)
@func()
example(tag: string, userName: string, userEmail: string): Git {
	return dag
		.git()
		.createTag(tag, userName, userEmail)
}

ensurePushedTag() 🔗

Return a tag after ensuring it exists on the remote.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
tagString !-

Tag name to ensure exists on the remote

remoteString !"origin"

Remote name to fetch and push the tag against

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 ensure-pushed-tag --tag string --remote string
func (m *MyModule) Example(ctx context.Context, tag string, remote string) string  {
	return dag.
			Git().
			EnsurePushedTag(ctx, tag, remote)
}
@function
async def example(tag: str, remote: str) -> str:
	return await (
		dag.git()
		.ensure_pushed_tag(tag, remote)
	)
@func()
async example(tag: string, remote: string): Promise<string> {
	return dag
		.git()
		.ensurePushedTag(tag, remote)
}

ensureRef() 🔗

Resolve a ref or fail with a clear missing-ref error.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
refString !-

Git ref or SHA to resolve

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 ensure-ref --ref string
func (m *MyModule) Example(ctx context.Context, ref string) string  {
	return dag.
			Git().
			EnsureRef(ctx, ref)
}
@function
async def example(ref: str) -> str:
	return await (
		dag.git()
		.ensure_ref(ref)
	)
@func()
async example(ref: string): Promise<string> {
	return dag
		.git()
		.ensureRef(ref)
}

getChangedComponents() 🔗

Return discovered components whose files changed between two refs.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
baseRefString !-

Base Git ref or SHA

headRefString !-

Head Git ref or SHA

componentRoots[String ! ] !-

Component root directories or glob-like patterns

sharedPaths[String ! ] null

Paths that affect all components

singleComponentBoolean false

Treat repository as one component

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-changed-components --base-ref string --head-ref string --component-roots string1 --component-roots string2
func (m *MyModule) Example(ctx context.Context, baseRef string, headRef string, componentRoots []string) []string  {
	return dag.
			Git().
			GetChangedComponents(ctx, baseRef, headRef, componentRoots)
}
@function
async def example(base_ref: str, head_ref: str, component_roots: List[str]) -> List[str]:
	return await (
		dag.git()
		.get_changed_components(base_ref, head_ref, component_roots)
	)
@func()
async example(baseRef: string, headRef: string, componentRoots: string[]): Promise<string[]> {
	return dag
		.git()
		.getChangedComponents(baseRef, headRef, componentRoots)
}

getChangedDirs() 🔗

Return unique changed directories between two refs.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
baseRefString !-

Base Git ref or SHA

headRefString !-

Head Git ref or SHA

paths[String ! ] null

Optional path filters relative to the repository root

depthInteger !1

Directory depth to return

diffFilterString !"ACMRTUXB"

Git diff-filter status letters

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-changed-dirs --base-ref string --head-ref string --depth integer --diff-filter string
func (m *MyModule) Example(ctx context.Context, baseRef string, headRef string, depth int, diffFilter string) []string  {
	return dag.
			Git().
			GetChangedDirs(ctx, baseRef, headRef, depth, diffFilter)
}
@function
async def example(base_ref: str, head_ref: str, depth: int, diff_filter: str) -> List[str]:
	return await (
		dag.git()
		.get_changed_dirs(base_ref, head_ref, depth, diff_filter)
	)
@func()
async example(baseRef: string, headRef: string, depth: number, diffFilter: string): Promise<string[]> {
	return dag
		.git()
		.getChangedDirs(baseRef, headRef, depth, diffFilter)
}

getChangedDirsSinceMergeBase() 🔗

Return unique changed directories from the merge base of base_ref and head_ref to head_ref.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
baseRefString !-

Base Git ref or SHA

headRefString !"HEAD"

Head Git ref or SHA

paths[String ! ] null

Optional path filters relative to the repository root

depthInteger !1

Directory depth to return

diffFilterString !"ACMRTUXB"

Git diff-filter status letters

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-changed-dirs-since-merge-base --base-ref string --head-ref string --depth integer --diff-filter string
func (m *MyModule) Example(ctx context.Context, baseRef string, headRef string, depth int, diffFilter string) []string  {
	return dag.
			Git().
			GetChangedDirsSinceMergeBase(ctx, baseRef, headRef, depth, diffFilter)
}
@function
async def example(base_ref: str, head_ref: str, depth: int, diff_filter: str) -> List[str]:
	return await (
		dag.git()
		.get_changed_dirs_since_merge_base(base_ref, head_ref, depth, diff_filter)
	)
@func()
async example(baseRef: string, headRef: string, depth: number, diffFilter: string): Promise<string[]> {
	return dag
		.git()
		.getChangedDirsSinceMergeBase(baseRef, headRef, depth, diffFilter)
}

getChangedFiles() 🔗

Return changed file paths between two refs.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
baseRefString !-

Base Git ref or SHA

headRefString !-

Head Git ref or SHA

paths[String ! ] null

Optional path filters relative to the repository root

diffFilterString !"ACMRTUXB"

Git diff-filter status letters

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-changed-files --base-ref string --head-ref string --diff-filter string
func (m *MyModule) Example(ctx context.Context, baseRef string, headRef string, diffFilter string) []string  {
	return dag.
			Git().
			GetChangedFiles(ctx, baseRef, headRef, diffFilter)
}
@function
async def example(base_ref: str, head_ref: str, diff_filter: str) -> List[str]:
	return await (
		dag.git()
		.get_changed_files(base_ref, head_ref, diff_filter)
	)
@func()
async example(baseRef: string, headRef: string, diffFilter: string): Promise<string[]> {
	return dag
		.git()
		.getChangedFiles(baseRef, headRef, diffFilter)
}

getChangedFilesSinceMergeBase() 🔗

Return changed file paths from the merge base of base_ref and head_ref to head_ref.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
baseRefString !-

Base Git ref or SHA

headRefString !"HEAD"

Head Git ref or SHA

paths[String ! ] null

Optional path filters relative to the repository root

diffFilterString !"ACMRTUXB"

Git diff-filter status letters

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-changed-files-since-merge-base --base-ref string --head-ref string --diff-filter string
func (m *MyModule) Example(ctx context.Context, baseRef string, headRef string, diffFilter string) []string  {
	return dag.
			Git().
			GetChangedFilesSinceMergeBase(ctx, baseRef, headRef, diffFilter)
}
@function
async def example(base_ref: str, head_ref: str, diff_filter: str) -> List[str]:
	return await (
		dag.git()
		.get_changed_files_since_merge_base(base_ref, head_ref, diff_filter)
	)
@func()
async example(baseRef: string, headRef: string, diffFilter: string): Promise<string[]> {
	return dag
		.git()
		.getChangedFilesSinceMergeBase(baseRef, headRef, diffFilter)
}

getChangedPaths() 🔗

Return changed paths inside diff_path between target_branch and HEAD

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
targetBranchString !"master"

Target branch or ref to diff against

diffPathString "."

Path to scope the diff (relative to repo root)

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-changed-paths --target-branch string
func (m *MyModule) Example(ctx context.Context, targetBranch string) []string  {
	return dag.
			Git().
			GetChangedPaths(ctx, targetBranch)
}
@function
async def example(target_branch: str) -> List[str]:
	return await (
		dag.git()
		.get_changed_paths(target_branch)
	)
@func()
async example(targetBranch: string): Promise<string[]> {
	return dag
		.git()
		.getChangedPaths(targetBranch)
}

getComponents() 🔗

Return discovered component roots in stable sorted order.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
componentRoots[String ! ] !-

Component root directories or glob-like patterns

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-components --component-roots string1 --component-roots string2
func (m *MyModule) Example(ctx context.Context, componentRoots []string) []string  {
	return dag.
			Git().
			GetComponents(ctx, componentRoots)
}
@function
async def example(component_roots: List[str]) -> List[str]:
	return await (
		dag.git()
		.get_components(component_roots)
	)
@func()
async example(componentRoots: string[]): Promise<string[]> {
	return dag
		.git()
		.getComponents(componentRoots)
}

getCurrentBranch() 🔗

Return the current branch name, or an empty string for detached HEAD.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-current-branch
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Git().
			GetCurrentBranch(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.get_current_branch()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.getCurrentBranch()
}

getCurrentRef() 🔗

Return the current symbolic ref, or the full HEAD SHA for detached HEAD.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-current-ref
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Git().
			GetCurrentRef(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.get_current_ref()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.getCurrentRef()
}

getDefaultBranch() 🔗

Return the remote default branch name.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
remoteString !"origin"

Remote name

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-default-branch --remote string
func (m *MyModule) Example(ctx context.Context, remote string) string  {
	return dag.
			Git().
			GetDefaultBranch(ctx, remote)
}
@function
async def example(remote: str) -> str:
	return await (
		dag.git()
		.get_default_branch(remote)
	)
@func()
async example(remote: string): Promise<string> {
	return dag
		.git()
		.getDefaultBranch(remote)
}

getFileContentsAtRef() 🔗

Return file contents from a Git ref.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
refString !-

Git ref or SHA to read from

pathString !-

File path relative to the repository root

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-file-contents-at-ref --ref string --path string
func (m *MyModule) Example(ctx context.Context, ref string, path string) string  {
	return dag.
			Git().
			GetFileContentsAtRef(ctx, ref, path)
}
@function
async def example(ref: str, path: str) -> str:
	return await (
		dag.git()
		.get_file_contents_at_ref(ref, path)
	)
@func()
async example(ref: string, path: string): Promise<string> {
	return dag
		.git()
		.getFileContentsAtRef(ref, path)
}

getHeadSha() 🔗

Return full commit SHA for HEAD.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-head-sha
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Git().
			GetHeadSha(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.get_head_sha()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.getHeadSha()
}

getLatestTag() 🔗

Return the latest matching tag, or an empty string when none match.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
patternString !"*"

Optional tag filter pattern (glob)

semverBoolean true

Only consider semantic version tags

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-latest-tag --pattern string
func (m *MyModule) Example(ctx context.Context, pattern string) string  {
	return dag.
			Git().
			GetLatestTag(ctx, pattern)
}
@function
async def example(pattern: str) -> str:
	return await (
		dag.git()
		.get_latest_tag(pattern)
	)
@func()
async example(pattern: string): Promise<string> {
	return dag
		.git()
		.getLatestTag(pattern)
}

getMergeBase() 🔗

Return the merge-base commit shared by two refs.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
baseRefString !-

Base Git ref or SHA

headRefString !-

Head Git ref or SHA

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-merge-base --base-ref string --head-ref string
func (m *MyModule) Example(ctx context.Context, baseRef string, headRef string) string  {
	return dag.
			Git().
			GetMergeBase(ctx, baseRef, headRef)
}
@function
async def example(base_ref: str, head_ref: str) -> str:
	return await (
		dag.git()
		.get_merge_base(base_ref, head_ref)
	)
@func()
async example(baseRef: string, headRef: string): Promise<string> {
	return dag
		.git()
		.getMergeBase(baseRef, headRef)
}

getRemoteUrl() 🔗

Return the configured URL for a remote.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
remoteString !"origin"

Remote name

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-remote-url --remote string
func (m *MyModule) Example(ctx context.Context, remote string) string  {
	return dag.
			Git().
			GetRemoteUrl(ctx, remote)
}
@function
async def example(remote: str) -> str:
	return await (
		dag.git()
		.get_remote_url(remote)
	)
@func()
async example(remote: string): Promise<string> {
	return dag
		.git()
		.getRemoteUrl(remote)
}

getShortCommitSha() 🔗

Return short commit SHA for HEAD

Return Type
String !
Arguments
NameTypeDefault ValueDescription
lengthInteger 8

Length of the short SHA

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-short-commit-sha
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Git().
			GetShortCommitSha(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.get_short_commit_sha()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.getShortCommitSha()
}

getStatusPorcelain() 🔗

Return git status in porcelain format.

Return Type
String !
Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-status-porcelain
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Git().
			GetStatusPorcelain(ctx)
}
@function
async def example() -> str:
	return await (
		dag.git()
		.get_status_porcelain()
	)
@func()
async example(): Promise<string> {
	return dag
		.git()
		.getStatusPorcelain()
}

getTags() 🔗

Return tags in the repository, optionally filtered by glob pattern.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
patternString !"*"

Optional tag filter pattern (glob)

sortString !"version"

Tag sort key: version, refname, or any git tag sort key

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-tags --pattern string --sort string
func (m *MyModule) Example(ctx context.Context, pattern string, sort string) []string  {
	return dag.
			Git().
			GetTags(ctx, pattern, sort)
}
@function
async def example(pattern: str, sort: str) -> List[str]:
	return await (
		dag.git()
		.get_tags(pattern, sort)
	)
@func()
async example(pattern: string, sort: string): Promise<string[]> {
	return dag
		.git()
		.getTags(pattern, sort)
}

getTagsPointingAt() 🔗

Return tags that point at a ref.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
refString !"HEAD"

Git ref to inspect

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 get-tags-pointing-at --ref string
func (m *MyModule) Example(ctx context.Context, ref string) []string  {
	return dag.
			Git().
			GetTagsPointingAt(ctx, ref)
}
@function
async def example(ref: str) -> List[str]:
	return await (
		dag.git()
		.get_tags_pointing_at(ref)
	)
@func()
async example(ref: string): Promise<string[]> {
	return dag
		.git()
		.getTagsPointingAt(ref)
}

hasChanges() 🔗

Return whether any files changed between two refs.

Return Type
Boolean !
Arguments
NameTypeDefault ValueDescription
baseRefString !-

Base Git ref or SHA

headRefString !-

Head Git ref or SHA

paths[String ! ] null

Optional path filters relative to the repository root

diffFilterString !"ACMRTUXB"

Git diff-filter status letters

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 has-changes --base-ref string --head-ref string --diff-filter string
func (m *MyModule) Example(ctx context.Context, baseRef string, headRef string, diffFilter string) bool  {
	return dag.
			Git().
			HasChanges(ctx, baseRef, headRef, diffFilter)
}
@function
async def example(base_ref: str, head_ref: str, diff_filter: str) -> bool:
	return await (
		dag.git()
		.has_changes(base_ref, head_ref, diff_filter)
	)
@func()
async example(baseRef: string, headRef: string, diffFilter: string): Promise<boolean> {
	return dag
		.git()
		.hasChanges(baseRef, headRef, diffFilter)
}

hasCleanWorktree() 🔗

Return whether the repository worktree has no pending changes.

Return Type
Boolean !
Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 has-clean-worktree
func (m *MyModule) Example(ctx context.Context) bool  {
	return dag.
			Git().
			HasCleanWorktree(ctx)
}
@function
async def example() -> bool:
	return await (
		dag.git()
		.has_clean_worktree()
	)
@func()
async example(): Promise<boolean> {
	return dag
		.git()
		.hasCleanWorktree()
}

hasFileAtRef() 🔗

Return whether a file exists at a Git ref.

Return Type
Boolean !
Arguments
NameTypeDefault ValueDescription
refString !-

Git ref or SHA to inspect

pathString !-

File path relative to the repository root

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 has-file-at-ref --ref string --path string
func (m *MyModule) Example(ctx context.Context, ref string, path string) bool  {
	return dag.
			Git().
			HasFileAtRef(ctx, ref, path)
}
@function
async def example(ref: str, path: str) -> bool:
	return await (
		dag.git()
		.has_file_at_ref(ref, path)
	)
@func()
async example(ref: string, path: string): Promise<boolean> {
	return dag
		.git()
		.hasFileAtRef(ref, path)
}

hasTag() 🔗

Return whether a tag exists in the repository.

Return Type
Boolean !
Arguments
NameTypeDefault ValueDescription
tagString !-

Tag name to check

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 has-tag --tag string
func (m *MyModule) Example(ctx context.Context, tag string) bool  {
	return dag.
			Git().
			HasTag(ctx, tag)
}
@function
async def example(tag: str) -> bool:
	return await (
		dag.git()
		.has_tag(tag)
	)
@func()
async example(tag: string): Promise<boolean> {
	return dag
		.git()
		.hasTag(tag)
}

pushTag() 🔗

Push a local tag to a remote.

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
tagString !-

Tag name to push

remoteString !"origin"

Remote name to push the tag to

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 push-tag --tag string --remote string
func (m *MyModule) Example(tag string, remote string) *dagger.Git  {
	return dag.
			Git().
			PushTag(tag, remote)
}
@function
def example(tag: str, remote: str) -> dagger.Git:
	return (
		dag.git()
		.push_tag(tag, remote)
	)
@func()
example(tag: string, remote: string): Git {
	return dag
		.git()
		.pushTag(tag, remote)
}

withFetchedRefs() 🔗

Fetch refs from remote and keep them available for later Git calls.

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
remoteString !"origin"

Remote name to fetch refs from

refspecs[String ! ] null

Optional refspecs to fetch

depthInteger null

Optional shallow fetch depth

pruneBoolean false

Prune deleted remote-tracking refs

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 with-fetched-refs --remote string
func (m *MyModule) Example(remote string) *dagger.Git  {
	return dag.
			Git().
			WithFetchedRefs(remote)
}
@function
def example(remote: str) -> dagger.Git:
	return (
		dag.git()
		.with_fetched_refs(remote)
	)
@func()
example(remote: string): Git {
	return dag
		.git()
		.withFetchedRefs(remote)
}

withFetchedTags() 🔗

Fetch tags from remote.

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
remoteString !"origin"

Remote name to fetch tags from

pruneBoolean false

Prune deleted tags

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 with-fetched-tags --remote string
func (m *MyModule) Example(remote string) *dagger.Git  {
	return dag.
			Git().
			WithFetchedTags(remote)
}
@function
def example(remote: str) -> dagger.Git:
	return (
		dag.git()
		.with_fetched_tags(remote)
	)
@func()
example(remote: string): Git {
	return dag
		.git()
		.withFetchedTags(remote)
}

withHttpsTokenAuth() 🔗

Configure HTTPS token authentication for Git operations.

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
hostString !-

HTTPS Git host to authenticate against

tokenSecret !-

HTTPS token secret

usernameString null

Optional HTTPS username

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 with-https-token-auth --host string --token env:MYSECRET
func (m *MyModule) Example(host string, token *dagger.Secret) *dagger.Git  {
	return dag.
			Git().
			WithHttpsTokenAuth(host, token)
}
@function
def example(host: str, token: dagger.Secret) -> dagger.Git:
	return (
		dag.git()
		.with_https_token_auth(host, token)
	)
@func()
example(host: string, token: Secret): Git {
	return dag
		.git()
		.withHttpsTokenAuth(host, token)
}

withSshKeyAuth() 🔗

Configure SSH key authentication for Git operations.

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
privateKeySecret !-

SSH private key secret

knownHostsSecret !-

SSH known_hosts secret

hostString null

Optional SSH Git host to configure

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 with-ssh-key-auth --private-key env:MYSECRET --known-hosts env:MYSECRET
func (m *MyModule) Example(privateKey *dagger.Secret, knownHosts *dagger.Secret) *dagger.Git  {
	return dag.
			Git().
			WithSshKeyAuth(privateKey, knownHosts)
}
@function
def example(private_key: dagger.Secret, known_hosts: dagger.Secret) -> dagger.Git:
	return (
		dag.git()
		.with_ssh_key_auth(private_key, known_hosts)
	)
@func()
example(privateKey: Secret, knownHosts: Secret): Git {
	return dag
		.git()
		.withSshKeyAuth(privateKey, knownHosts)
}

withUnshallow() 🔗

Ensure a shallow repository has full history for later Git calls.

Return Type
Git !
Arguments
NameTypeDefault ValueDescription
remoteString !"origin"

Remote name to fetch full history from

Example
dagger -m github.com/riftonix/daggerverse/modules/git@703b81a8b09d3f51bb892df44ef3180057f92e4c call \
 with-unshallow --remote string
func (m *MyModule) Example(remote string) *dagger.Git  {
	return dag.
			Git().
			WithUnshallow(remote)
}
@function
def example(remote: str) -> dagger.Git:
	return (
		dag.git()
		.with_unshallow(remote)
	)
@func()
example(remote: string): Git {
	return dag
		.git()
		.withUnshallow(remote)
}