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 to str.

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 a str

  • repo (str|None) – The repository to run the command against. When None, uses the value of repo

  • strip (bool) – (Default: True) Whether to run str.strip() on the string outputs of the command

  • stderr (bool) – (Default: False) When True, includes the stderr output in the response like so: (stdout, stderr) When False, simply returns stdout directly as a str

Return str stdout

(when stderr=False) The text outputted to stdout by the command

Return Tuple[str,str] stdout_err

(when stderr=True) A tuple containing (stdout: str, stderr: str)