git
This module has been generated via dagger init and serves as a reference tobasic 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@acd1d25396d306aa4bc2f7e43d2fd25ae257b7acEntrypoint
Return Type
Git !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Git repository directory (must include .git) |
| imageRegistry | String | "docker.io" | Git image registry |
| imageRepository | String | "alpine/git" | Git image repositroy |
| imageTag | String | "2.52.0" | Git image tag |
| userId | String | "65532" | Git image user |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac 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@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
containerfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| tag | String ! | - | Tag name to create |
| message | String | null | Optional annotated tag message |
| userName | String ! | "dagger-ci" | Tagger name for annotated tags |
| userEmail | String ! | "dagger-ci@example.local" | Tagger email for annotated tags |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
create-tag --tag string --user-name string --user-email stringfunc (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)
}ensureRef() 🔗
Resolve a ref or fail with a clear missing-ref error.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | Git ref or SHA to resolve |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
ensure-ref --ref stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseRef | String ! | - | Base Git ref or SHA |
| headRef | String ! | - | Head Git ref or SHA |
| componentRoots | [String ! ] ! | - | Component root directories or glob-like patterns |
| sharedPaths | [String ! ] | null | Paths that affect all components |
| singleComponent | Boolean | false | Treat repository as one component |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-changed-components --base-ref string --head-ref string --component-roots string1 --component-roots string2func (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseRef | String ! | - | Base Git ref or SHA |
| headRef | String ! | - | Head Git ref or SHA |
| paths | [String ! ] | null | Optional path filters relative to the repository root |
| depth | Integer ! | 1 | Directory depth to return |
| diffFilter | String ! | "ACMRTUXB" | Git diff-filter status letters |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-changed-dirs --base-ref string --head-ref string --depth integer --diff-filter stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseRef | String ! | - | Base Git ref or SHA |
| headRef | String ! | "HEAD" | Head Git ref or SHA |
| paths | [String ! ] | null | Optional path filters relative to the repository root |
| depth | Integer ! | 1 | Directory depth to return |
| diffFilter | String ! | "ACMRTUXB" | Git diff-filter status letters |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-changed-dirs-since-merge-base --base-ref string --head-ref string --depth integer --diff-filter stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseRef | String ! | - | Base Git ref or SHA |
| headRef | String ! | - | Head Git ref or SHA |
| paths | [String ! ] | null | Optional path filters relative to the repository root |
| diffFilter | String ! | "ACMRTUXB" | Git diff-filter status letters |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-changed-files --base-ref string --head-ref string --diff-filter stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseRef | String ! | - | Base Git ref or SHA |
| headRef | String ! | "HEAD" | Head Git ref or SHA |
| paths | [String ! ] | null | Optional path filters relative to the repository root |
| diffFilter | String ! | "ACMRTUXB" | Git diff-filter status letters |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-changed-files-since-merge-base --base-ref string --head-ref string --diff-filter stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| targetBranch | String ! | "master" | Target branch or ref to diff against |
| diffPath | String | "." | Path to scope the diff (relative to repo root) |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-changed-paths --target-branch stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| componentRoots | [String ! ] ! | - | Component root directories or glob-like patterns |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-components --component-roots string1 --component-roots string2func (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@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-current-branchfunc (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@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-current-reffunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| remote | String ! | "origin" | Remote name |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-default-branch --remote stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | Git ref or SHA to read from |
| path | String ! | - | File path relative to the repository root |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-file-contents-at-ref --ref string --path stringfunc (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@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-head-shafunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| pattern | String ! | "*" | Optional tag filter pattern (glob) |
| semver | Boolean | true | Only consider semantic version tags |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-latest-tag --pattern stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseRef | String ! | - | Base Git ref or SHA |
| headRef | String ! | - | Head Git ref or SHA |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-merge-base --base-ref string --head-ref stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| remote | String ! | "origin" | Remote name |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-remote-url --remote stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| length | Integer | 8 | Length of the short SHA |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-short-commit-shafunc (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@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-status-porcelainfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| pattern | String ! | "*" | Optional tag filter pattern (glob) |
| sort | String ! | "version" | Tag sort key: version, refname, or any git tag sort key |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-tags --pattern string --sort stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | "HEAD" | Git ref to inspect |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
get-tags-pointing-at --ref stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| baseRef | String ! | - | Base Git ref or SHA |
| headRef | String ! | - | Head Git ref or SHA |
| paths | [String ! ] | null | Optional path filters relative to the repository root |
| diffFilter | String ! | "ACMRTUXB" | Git diff-filter status letters |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
has-changes --base-ref string --head-ref string --diff-filter stringfunc (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@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
has-clean-worktreefunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | Git ref or SHA to inspect |
| path | String ! | - | File path relative to the repository root |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
has-file-at-ref --ref string --path stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| tag | String ! | - | Tag name to check |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
has-tag --tag stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| tag | String ! | - | Tag name to push |
| remote | String ! | "origin" | Remote name to push the tag to |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
push-tag --tag string --remote stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| remote | String ! | "origin" | Remote name to fetch refs from |
| refspecs | [String ! ] | null | Optional refspecs to fetch |
| depth | Integer | null | Optional shallow fetch depth |
| prune | Boolean | false | Prune deleted remote-tracking refs |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
with-fetched-refs --remote stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| remote | String ! | "origin" | Remote name to fetch tags from |
| prune | Boolean | false | Prune deleted tags |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
with-fetched-tags --remote stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| host | String ! | - | HTTPS Git host to authenticate against |
| token | Secret ! | - | HTTPS token secret |
| username | String | null | Optional HTTPS username |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
with-https-token-auth --host string --token env:MYSECRETfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| privateKey | Secret ! | - | SSH private key secret |
| knownHosts | Secret ! | - | SSH known_hosts secret |
| host | String | null | Optional SSH Git host to configure |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
with-ssh-key-auth --private-key env:MYSECRET --known-hosts env:MYSECRETfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| remote | String ! | "origin" | Remote name to fetch full history from |
Example
dagger -m github.com/riftonix/daggerverse/modules/git@acd1d25396d306aa4bc2f7e43d2fd25ae257b7ac call \
with-unshallow --remote stringfunc (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)
}