submodule
¶
For git-submodule(1)
.
- class libvcs.cmd.git.GitSubmoduleCmd(*, path, cmd=None)[source]¶
Bases:
object
Run submodule commands in a git repository.
Lite, typed, pythonic wrapper for git-submodule(1).
- Parameters:
Examples
>>> GitSubmoduleCmd(path=tmp_path) <GitSubmoduleCmd path=...>
>>> GitSubmoduleCmd(path=tmp_path).run(quiet=True) 'fatal: not a git repository (or any of the parent directories): .git'
>>> GitSubmoduleCmd(path=example_git_repo.path).run(quiet=True) ''
- __init__(*, path, cmd=None)[source]¶
Lite, typed, pythonic wrapper for git-submodule(1).
- Parameters:
- Return type:
None
Examples
>>> GitSubmoduleCmd(path=tmp_path) <GitSubmoduleCmd path=...>
>>> GitSubmoduleCmd(path=tmp_path).run(quiet=True) 'fatal: not a git repository (or any of the parent directories): .git'
>>> GitSubmoduleCmd(path=example_git_repo.path).run(quiet=True) ''
-
path:
Path
¶ Directory to check out
- run(command=None, local_flags=None, *, quiet=None, cached=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]¶
Run a command against a git submodule.
Wraps git submodule.
- Return type:
- Parameters:
Examples
>>> GitSubmoduleCmd(path=example_git_repo.path).run() ''
- init(*, path=None, log_in_real_time=False, check_returncode=None)[source]¶
Git submodule init.
- Return type:
- Parameters:
Examples
>>> GitSubmoduleCmd(path=example_git_repo.path).init() ''
- update(*, path=None, init=None, force=None, checkout=None, rebase=None, merge=None, recursive=None, log_in_real_time=False, check_returncode=None, **kwargs)[source]¶
Git submodule update.
- Return type:
- Parameters:
Examples
>>> GitSubmoduleCmd(path=example_git_repo.path).update() '' >>> GitSubmoduleCmd(path=example_git_repo.path).update(init=True) '' >>> GitSubmoduleCmd( ... path=example_git_repo.path ... ).update(init=True, recursive=True) '' >>> GitSubmoduleCmd(path=example_git_repo.path).update(force=True) '' >>> GitSubmoduleCmd(path=example_git_repo.path).update(checkout=True) '' >>> GitSubmoduleCmd(path=example_git_repo.path).update(rebase=True) '' >>> GitSubmoduleCmd(path=example_git_repo.path).update(merge=True) ''