1

我正在使用 GIT 团队项目运行 TFS 2013。当我git clone从本地 Windows 服务器之一执行时,我没有任何问题:

-bash-4.1$ git clone "http://tfsadm:tfspas@tfs.server.com:8080/tfs/DefaultCollection/_git/Main"
Initialized empty Git repository in /home/tfsadm/Mainframe/.git/

但是当我git clone从 Linux 执行时,我收到以下错误:

error: The requested URL returned error: 401 while accessing http://tfsadm:tfspas@tfs.server.com:8080/tfs/DefaultCollection/_git/Mainframe/info/refs fatal: HTTP request failed
4

1 回答 1

3

错误:请求的 URL 返回错误:访问https://github.com/Joey-myproject/repo.git/info/refs时出现 401致命:HTTP 请求失败

是一个经常重复出现的错误。

发生这种情况的原因之一是客户端无权访问该资源。

一般的解决方案是检查以下内容:

  1. 你有稳定的 git 版本吗?
  2. 遥控器是否正确配置?
  3. 如果启用了 2FA,则提供访问令牌。
  4. 仔细检查您的权限(配置中的用户名/密码)也许还尝试使用格式“ https://username@mydomain.org/project.git
  5. 尝试 ssh 而不是 https

我不确定,但是您是否已经看到此链接Can't clone a github repo on Linux via HTTPS?它可以提供一些额外的信息。

于 2015-01-27T16:04:42.390 回答