atmos git
Publish generated configuration and other artifacts to Git as part of your infrastructure workflows. Atmos manages repository operations with shared authentication, signing settings, and safeguards that you can reuse locally and in CI.
Define managed repositories, authentication, commit signing, and local Git hooks under the top-level git section of atmos.yaml.
Managed Repositories
Publish generated files from the CLI, from kind: git lifecycle hooks such as after.terraform.apply, or from native CI workflows. Managed repositories support initialization, cloning, pulling, inspection, diffs, commits, pushing, and cleanup by logical name.
Define repositories once under git.repositories in atmos.yaml, then refer to them everywhere by logical name:
git:
repositories:
flux-deploy:
uri: https://github.com/acme/flux-deploy.git
auth:
identity: platform-admin
generated-terraform:
uri: https://github.com/acme/generated-terraform.git
atmos git clone flux-deploy
atmos git status flux-deploy
atmos git commit flux-deploy --message="Update manifests" --path=clusters/prod
atmos git push flux-deploy
atmos git clean flux-deploy --dry-run
Repository names (flux-deploy, generated-terraform) are arbitrary, user-defined logical keys — not reserved values. Repository configuration follows standard Atmos deep-merge, so repositories can be defined in imported configuration and overridden per environment.
How It Differs from Plain Git
Every atmos git command goes through the shared Atmos Git service, which adds:
- Authentication via Atmos Auth — repository
auth.identitybrings linked integrations (such asgithub/sts) along automatically; the ambient credential broker covers the zero-config CI case; your own credential helpers and SSH agent always continue to work. - Safety rules — pulls are always fast-forward-only, force push is never performed, rejected pushes retry with a bounded
pull --rebase+ re-push loop, and path-scoped commits refuse to commit when unrelated dirty files are present. - Reconcile semantics —
atmos git cloneis idempotent: it clones when the workdir is absent and fetches/fast-forwards when it already exists, which makes restored CI caches safe. - Automatic workdirs — managed repositories clone into a deterministic location under the Atmos XDG cache root, so the native CI cache captures them across runs for free.
- Native escape hatch —
init,clone,pull, andpushpass arguments after--verbatim to the underlying git invocation (e.g.,atmos git clone flux-deploy -- --no-tags), so Atmos safety rules and uncommon git flags compose.
Subcommands
Remove managed Git repository workdirs safely.
Clone or reconcile a managed Git repository, an ad hoc URI, or the current CI repository.
Stage managed paths and create a commit in a managed Git repository.
Show changes between the working tree and HEAD in a managed Git repository.
3 items
Initialize a managed Git repository from scratch, optionally seeded from another repository.
List Git repositories configured under git.repositories.
Fast-forward pull a managed Git repository or a local path.
Push commits to a remote Git repository with bounded retry and no force push.
Show the working tree status of a managed Git repository or a local path.
Related
- Git Configuration —
git.repositories,git.hooks, andgit.listinatmos.yaml kind: githooks — publish artifacts on lifecycle events likeafter.terraform.apply- Authentication — identities and integrations used by
auth.identity - CI Configuration — native CI detection used by no-arg
atmos git clone