git¶
-
async
_AsyncGit.git(*args, repo: str = None, strip=True, stderr=False) → Union[str, Tuple[str, str]][source]¶ Wrapper async method for calling
gitexecutable command against a repo - casts args tostr.This is intended for use internally by
_AsyncGitmethods, but is under a non-private method name to allow you to call Git commands semi-directly if the class methods are getting in the way.Example:
>>> Git().git('commit', '--amend', '-a', '-m', 'lorem ipsum dolor')
- Parameters
args (AnyStr|int|float|object|Any) – Positional command line arguments to pass to
git. Most formats are fine, as long as they can be casted into astrrepo (str|None) – The repository to run the command against. When
None, uses the value ofrepostrip (bool) – (Default:
True) Whether to runstr.strip()on the string outputs of the commandstderr (bool) – (Default:
False) WhenTrue, includes the stderr output in the response like so:(stdout, stderr)WhenFalse, simply returnsstdoutdirectly as astr
- Return str stdout
(when
stderr=False) The text outputted to stdout by the command- Return Tuple[str,str] stdout_err
(when
stderr=True) Atuplecontaining(stdout: str, stderr: str)