git Provider
ℹ️
Introduced in Togomak v1.0.0
The git data provider clones a git repository
to a specific directory
Opening the existing repository
data "git" "this" {
url = "."
}Cloning a new repository
{{#include ../../../examples/git/togomak.hcl}}Reusing remote stages, using togomak
{{#include ../../../examples/remote-stages/togomak.hcl}} Arguments Reference
url- The URL of the repository to clone.tag- The tag to checkout.tagtakes precedence overbranch.ref- The reference to checkout, in the formatrefs/tags/v3for example.reftakes precedence overtagandbranch.branch- The branch to checkout.refandtagtakes precedence overbranch.destination- The destination directory to clone the repository to, defaults to"memory", which clones into a temporary directory managed bytogomakcommit- The commit to checkout.depth- The depth of the clone.ca_bundle- The path to a CA bundle file or directory, (deprecated, does nothing).auth- The authentication credentials to use when cloning the repository. Structure documented belowfiles- The files to checkout from the repository. Accepts an array of file paths.
Attributes Reference
last_tag- The latest tag in the repository, defaults to""commits_since_last_tag- The number of commits since the last tag, defaults to0sha- The SHA of the commit, defaults to""ref- The ref of the commit, in the formatrefs/heads/<branch>orrefs/tags/<tag>, defaults to""is_tag- Whether the ref is a tag, defaults tofalsefiles- The files checked out from the repository. Returns a map, with the keys being the file paths and the values being the file contents.branch- The branch checked out from the repository. Returns a string.destination- The destination where the repository is stored.
The auth block supports: