fabtools.require.git

Git

This module provides high-level tools for managing Git repositories.

See also

fabtools.git

fabtools.require.git.working_copy(remote_url, path=None, branch='master', update=True, use_sudo=False, user=None)[source]

Require a working copy of the repository from the remote_url.

Clones or pulls from the repository under remote_url and checks out branch.

Parameters:
  • remote_url (str) – URL of the remote repository (e.g. https://github.com/ronnix/fabtools.git). The given URL will be the origin remote of the working copy.
  • path (str) – Absolute or relative path of the working copy on the filesystem. If this directory doesn’t exist yet, a new working copy is created through git clone. If the directory does exist and update == True, a git pull is issued. If path is None the git clone is issued in the current working directory and the directory name of the working copy is created by git.
  • branch (str) – Branch to switch to after cloning or pulling.
  • update (bool) – Whether or not to update an existing working copy via git pull.
  • use_sudo (bool) – If True execute git with fabric.operations.sudo(), else with fabric.operations.run().
  • user (str) – If use_sudo is True, run fabric.operations.sudo() with the given user. If use_sudo is False this parameter has no effect.

Project Versions

Table Of Contents

Previous topic

fabtools.require.files

Next topic

fabtools.require.groups

This Page