【问题标题】:Github: I've been granted "pull access" to a private repo but I can't clone the repo (but I can download a zip of the source code)Github:我已被授予对私有仓库的“拉取访问权限”,但我无法克隆该仓库(但我可以下载源代码的 zip)
【发布时间】:2018-08-31 08:09:51
【问题描述】:

我不确定在私人仓库中“拉取访问”意味着什么。我现在应该能够克隆它吗?我不能。

[1045](m7int01)~/codes>git clone https://github.com/glwhart/[repo_name]
Initialized empty Git repository in /zhome/glh43/codes/[repo_name]/.git/
error: The requested URL returned error: 403 Forbidden while 
accessing https://github.com/glwhart/[repo_name]/info/refs

fatal: HTTP request failed

但我可以下载源代码的 zip 文件...

【问题讨论】:

  • 也许您需要传递您的用户名?如果是这样,git help clone 并搜索 username
  • 您应该可以git clone https://username:password@github.com/glwhart/[repo_name],尽管明文传递您的密码并不是最好的办法
  • 在我以前的组织中,所有对github的http请求都被防火墙阻止了,我也曾经收到相同的消息

标签: git github git-pull git-clone


【解决方案1】:

首先检查您是否有可能缓存了错误凭据的 git 凭据助手:

git config credential.helper

按照建议,git clone https://username:password@github.com/... 可用于强制使用那些(正确的)凭据,仅用于测试。

【讨论】:

    【解决方案2】:

    很抱歉因为一个简单的问题占用了带宽。无论如何,github页面上的“复制到剪贴板”按钮(用于克隆回购)似乎给了我一个虚假的网址。今天早上我又试了一次,结果不一样了——但还是不行。

    类似于上面的几个建议/cmets,包括我在 url 中的用户名(但不是密码)起到了作用:

    git clone https://[username]@github.com/[orgname/reponame].git
    

    这连接正确,询问我的 github 密码,并且工作正常。

    感谢那些花时间回复的人。

    我仍然想知道“拉取访问”是否与任何其他类型的访问不同。邀请我的电子邮件说我已被授予“拉取访问权限”...

    【讨论】:

      猜你喜欢
      • 2012-08-13
      • 2012-12-11
      • 2018-10-20
      • 1970-01-01
      • 2017-06-16
      • 2017-06-30
      • 2012-10-19
      • 1970-01-01
      • 2021-11-08
      相关资源
      最近更新 更多