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 non existing 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.pull(path, use_sudo=False, user=None)[source]
Pull from a remote Git repository on an existing working copy.
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.
|
-
fabtools.git.checkout(path, branch='master', use_sudo=False, user=None)[source]
Checkout an existing branch of an existing Git working copy.
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.
|