git

Collection: builtin

Full Name: parallax.builtin.git

Aliases: ansible.builtin.git, git

Synopsis

Manage git

Parameters

NameTypeRequiredDefaultDescription
repostringyesgit, SSH, or HTTP(S) protocol address of the git repository
deststringyesThe path of where the repository should be checked out
versionstringHEADWhat version of the repository to check out
clonebooltrueIf no, do not clone the repository even if it does not exist locally
updatebooltrueIf no, do not retrieve new revisions from the origin repository
forceboolfalseIf yes, any modified files in the working repository will be discarded
recursivebooltrueIf no, repository will be cloned without the –recursive option
depthint0Create a shallow clone with a history truncated to the specified number or revisions
remotestringoriginName of the remote
accept_hostkeyboolfalseIf yes, ensure that SSH host keys are not checked
key_filestringSpecify an optional private key file path, on the target host, to use for the checkout
ssh_optsstringOptions git will pass to ssh when used as protocol
bareboolfalseIf yes, repository will be created as a bare repo
single_branchboolfalseClone only the history leading to the tip of a single branch
track_submodulesboolfalseIf yes, submodules will track the latest commits on their master branch
verify_commitboolfalseIf yes, when cloning or fetching, verify the signature of every commit
archivestringSpecify archive file path to create from the repository
separate_git_dirstringThe path to place the cloned repository’s Git directory
refspecstringAdd an additional refspec to be fetched
referencestringReference repository path
executablestringgitPath to git executable to use
umaskstringThe umask to set before doing any checkouts

Example

- name: Example git task
  git:
    repo: <your_repo>
    dest: <your_dest>