GitHTTPSFetcher

class GitHTTPSFetcher[源代码]
classmethod fetch(cls, git_host, repo_info, use_cache=False, commit=None, silent=True)[源代码]

Fetches git repo by HTTPS protocol.

参数
  • git_host (str) – git仓库的主地址。例如:github.com

  • repo_info (str) – 格式为``”repo_owner/repo_name[:tag_name/:branch_name]”的字符串,其中可选参数为batch。如果没有特殊指定默认的分支为``master,例如:"brain_sdk/MegBrain[:hub]"

  • use_cache (bool) – 选择使用本地缓存的代码或完全重新拉取代码。

  • commit (Optional[str]) – GitHub或GitLab的commit id。

  • silent (bool) – whether to accept the stdout and stderr of the subprocess with PIPE, instead of displaying on the screen.

返回类型

str

返回

directory where the repo code is stored.