Skip to content

git

!git

Category: files

Clone or update a git repository on the target. Idempotent — compares local HEAD/branch against remote and updates only when needed. SSH key auth only.

Parameters

NameTypeRequiredDescription
repostringyesRepository URL (https/http or ssh style).
pathpathyesRemote destination directory for the checkout.
branchstringnoBranch to checkout/switch to. Default main.
ssh_optionsmapnoMap of extra SSH options passed as -o KEY=VALUE.
accept_keysboolnoAuto-accept new SSH host keys via StrictHostKeyChecking=accept-new. Default true.
updateboolnoPull from remote if local HEAD differs. Default true.
attributesmapnoFile attributes applied to the checkout directory: owner, group, mode.

Examples

- !git
  repo: git@github.com:example/app.git
  path: /srv/app
  branch: release
  ssh_options:
    IdentityFile: ~/.ssh/deploy_key