【问题标题】:Colaboratory - access to private repository from githubColaboratory - 从 github 访问私有存储库
【发布时间】:2018-11-27 04:49:12
【问题描述】:

在 colaboratory 中,我可以使用“!”执行 bash 命令像符号一样 bash !git clone repository-name 用于克隆 github 存储库。

当存储库是公共的时它可以完美地工作,但当存储库是私有的时它不起作用,因为它在没有输入的情况下请求用户名/密码。 我该如何解决这个问题?

非常感谢!

【问题讨论】:

  • 使用带有用户名和密码的 HTTP 克隆会发生什么?例如,!git clone https://username:password@github.com/username/repository.git

标签: github jupyter-notebook google-colaboratory


【解决方案1】:

有关信息,执行“!git something”将检索以 git 开头的最后一个命令,并将“something”附加到它。
无论如何,对我来说,您的错误似乎暗示您在以前的 git 命令或“存储库名称”中有一个列,并且该列后跟一个“a”

【讨论】:

    【解决方案2】:

    您可以从 url 本身传递用户名和密码:-

    !git clone https://username:password@github.com/username/repository.git
    

    【讨论】:

      【解决方案3】:
      猜你喜欢
      • 2013-03-23
      • 1970-01-01
      • 2013-08-17
      • 2018-09-23
      • 2023-03-16
      • 2018-11-02
      • 2021-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多