Manage git repositories and configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pyinfra-dev/pyinfra/llms.txt
Use this file to discover all available pages before exploring further.
Powered by Mintlify
Auto-generate your docs
Manage git repositories and configuration
Manage git repositories and configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pyinfra-dev/pyinfra/llms.txt
Use this file to discover all available pages before exploring further.
git.configgit.config(
key,
value,
multi_value=False,
repo=None,
system=False,
)
git.repogit.repo(
src,
dest,
branch=None,
pull=True,
rebase=False,
user=None,
group=None,
ssh_keyscan=False,
update_submodules=False,
recursive_submodules=False,
)
git.worktreegit.worktree(
worktree,
repo=None,
detached=False,
new_branch=None,
commitish=None,
pull=True,
rebase=False,
from_remote_branch=None,
present=True,
force=False,
user=None,
group=None,
)
git.bare_repogit.bare_repo(
path,
user=None,
group=None,
present=True,
)
from pyinfra.operations import git
# Clone a repository
git.repo(
name="Clone repo",
src="https://github.com/Fizzadar/pyinfra.git",
dest="/usr/local/src/pyinfra",
)
# Set git config
git.config(
name="Always prune specified repo",
key="fetch.prune",
value="true",
repo="/usr/local/src/pyinfra",
)
# Create a bare repository
git.bare_repo(
name="Create bare repo",
path="/home/git/test.git",
)