git_push
git_push pushes refs from an existing project-relative Git repository. It returns a dependency. When refspecs is omitted, current branch is pushed to same branch name. Detached HEAD requires explicit refspecs unless tags=True, which pushes tags without a branch. Set tags=True to push all local tags. Already-up-to-date pushes succeed.
Host access and credential limitations match git_clone.
go-git exposes configured url and pushurl values as one ordered list. git_push uses final configured URL, matching go-git's push behavior. Remotes requiring pushes to multiple URLs are not supported.
Arguments
| Argument | Required | Description |
|---|---|---|
repository | No | Project-relative Git repository directory. Defaults to .. |
remote | No | Configured remote name. Defaults to origin. |
refspecs | No | Push refspec strings in fully qualified source:destination form, such as refs/heads/main:refs/heads/main. Defaults to current branch only. |
tags | No | Push all local tags in addition to selected non-tag refs. Cannot be combined with refspecs targeting tags. Defaults to False. |
force | No | Permit non-fast-forward updates. Defaults to False. |
deps | No | Dependencies to complete before pushing. |
Example
load("@git@1", "git_commit", "git_push")
commit = git_commit(
repository=".xx/output",
message="Update generated files",
deps=[generate],
)
git_push(
repository=".xx/output",
tags=True,
deps=[commit],
)