git¶
-
async
_AsyncGit.
git
(*args, repo: str = None, strip=True, stderr=False) → Union[str, Tuple[str, str]][source]¶ Wrapper async method for calling
git
executable command against a repo - casts args tostr
.This is intended for use internally by
_AsyncGit
methods, 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 astr
repo (str|None) – The repository to run the command against. When
None
, uses the value ofrepo
strip (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 returnsstdout
directly 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
) Atuple
containing(stdout: str, stderr: str)