Promise type to manage git repos


Fabio Tranchitella

Module stats

Total Downloads: 2697
Updated: Nov 3, 2021

Installation version

Released on Nov 1, 2021



cfbs add promise-type-git

git promise type


  • Name: git
  • Version: 0.1.2
  • Description: Manage git checkouts of repositories to deploy files or software.


  • git (the command line tool)


Name Type Description Mandatory Default
destination string Destination path No Promiser
repository string Git repository URL Yes -
bare boolean If true, clones the repository as bare repository No -
clone boolean If true, clones the repository if it doesn’t exist at the destination path No -
depth integer Create a shallow clone with a history truncated to the specified number or revisions. Set to 0 to perform a full clone. No 0
executable string Path to the git executable No git
force boolean If true, discard any local changes to the repository before updating it No -
recursive boolean If true, use the --recursive git option No yes
reference string If set, use the --reference git option with the given value No -
remote string Name of the git remote No origin
ssh_executable string Path to the ssh executable No ssh
ssh_options string Additional options for the git command, e.g. -o StrictHostKeyChecking=no No -
update boolean If true, updates the repository if it already exists at the destination path No -
version string The version of the repository to checkout. It can be a branch name, a tag name or a SHA-1 hash. No HEAD


Check out a git repository in a given destination path:

bundle agent main
      repository => "",
      destination => "/",
      version => "master";

Full example with almost all the attributes:

bundle agent main
      destination => "/",
      repository => "",
      bare => "true",
      clone => "true",
      depth => "1",
      executable => "/bin/git",
      force => "true",
      recursive => "true",
      remote => "origin",
      ssh_options => "UserKnownHostsFile=/dev/null",
      update => "true",
      version => "master";


This software was created by the team at AS, with many contributions from the community. Thanks everyone!

CFEngine is sponsored by AS


Feel free to open pull requests to expand this documentation, add features or fix problems. You can also pick up an existing task or file an issue in our bug tracker.


This software is licensed under the MIT License. See LICENSE in the root of the repository for the full license text.

comments powered by Disqus