在私有仓库 (Centos) 上进行 git 克隆时出错

  • 本文关键字:git 出错 Centos git
  • 更新时间 :
  • 英文 :


我正在使用 Centos,当我尝试从 Github.com 克隆我的私有仓库时,我遇到了一个奇怪的错误

我只是做

git clone https://github.com/Clemzd/GCLChallenge.git

我收到此错误:

Initialized empty Git repository in /home/makeitgreen/Documents/GCLChallenge/.git/
error: The requested URL returned error: 403 Forbidden while accessing     
https://github.com/Clemzd/GCLChallenge.git/info/refs
fatal: HTTP request failed

听起来我没有很好地配置我的 git。我记得我这样做是为了保存我的密码,错误可能来自此,但我不知道如何取消它。

git config --global credential.helper wincred

我在另一台机器上尝试过,它运行良好,因为它询问我的凭据。

感谢您的帮助!

解决方案 : 我的 centos 有一个 git 版本 <1.7.9,我必须指定凭据作为 url 的一部分,所以我已将版本改进为 2.2.0,现在它可以工作了!

为什么你甚至在 Centos 上指定 wincred? 您可以尝试使用git config --global --unset credential.helper取消设置它们

然后阅读 http://git-scm.com/docs/gitcredentials 或有没有办法在使用 github 时跳过密码输入 https://

最新更新