fabtools.git

Git

This module provides low-level tools for managing Git repositories. You should normally not use them directly but rather use the high-level wrapper fabtools.require.git.working_copy() instead.

fabtools.git.clone(remote_url, path=None, use_sudo=False, user=None)[source]

Clone a remote Git repository into a new directory.

Parameters:
  • remote_url (str) – URL of the remote repository to clone.
  • path (str) – Path of the working copy directory. Must not exist yet.
  • 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.
fabtools.git.fetch(path, use_sudo=False, user=None)[source]

Fetch changes from the default remote repository.

This will fetch new changesets, but will not update the contents of the working tree unless yo do a merge or rebase.

Parameters:
  • path (str) – Path of the working copy directory. This directory must exist and be a Git working copy with a default remote to fetch from.
  • 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.
fabtools.git.pull(path, use_sudo=False, user=None, force=False)[source]

Fetch changes from the default remote repository and merge them.

Parameters:
  • path (str) – Path of the working copy directory. This directory must exist and be a Git working copy with a default remote to pull from.
  • 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.
  • force (bool) – If True, append the --force option to the command.
fabtools.git.checkout(path, branch='master', use_sudo=False, user=None, force=False)[source]

Checkout a branch to the working directory.

Parameters:
  • path (str) – Path of the working copy directory. This directory must exist and be a Git working copy.
  • branch (str) – Name of the branch to checkout.
  • 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.
  • force (bool) – If True, append the --force option to the command.
Read the Docs v: 0.16.0
Versions
latest
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.