Skip to Content

Git variables

git variables read repository metadata by running git commands. They are readonly, but still interact with the local repository and process environment.

branchName: ${git:branch, "main"} shortSha: ${git:sha1, "unknown"}

Use fallbacks when a config may resolve outside a git checkout. Common keys include branch, commit, sha1, message, remote, tag, describe, repo, owner, and timestamp.

See safe inspection for audit behavior and use in CI for automation patterns.

Last updated on