GitSSHFetcher

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

使用 SSH 协议拉取 git 仓库

参数
  • 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) – 是否使用本地已 fetch 的代码或者重新 fetch

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

  • silent (bool) – 是否将屏幕输出替换为带管道子进程的 stdout 或 stderr。

返回类型

str

返回

仓库代码存储文件夹