gpt4 book ai didi

linux - 从 Linux 服务器执行 GIT 克隆时出现 http 401.1 错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:17:21 26 4
gpt4 key购买 nike

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

-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/

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

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

最佳答案

Error: The requested URL returned error: 401 while accessing https://github.com/Joey-myproject/repo.git/info/refs fatal: HTTP request failed

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

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

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

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

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

关于linux - 从 Linux 服务器执行 GIT 克隆时出现 http 401.1 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28174630/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com