简体   繁体   English

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

[英]http 401.1 error while performing a GIT clone from a Linux server

I'm running TFS 2013 with a GIT team project. 我正在通过GIT团队项目运行TFS 2013。 When I perform a git clone from one of the local Windows servers I don't have any issues: 当我从本地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/

but when I perform a git clone from Linux, I get the following error: 但是当我从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 错误:访问https://github.com/Joey-myproject/repo.git/info/refs时 ,请求的URL返回错误:401致命:HTTP请求失败

is an often reoccuring error. 是经常发生的错误。

One of the reasons of this happening is because the client is not authorized to access to that resource. 发生这种情况的原因之一是因为客户端无权访问该资源。

A general solution is to check for the following: 通用解决方案是检查以下各项:

  1. Do you have a stable git version? 您有稳定的git版本吗?
  2. Is the remote correct configured? 遥控器配置正确吗?
  3. If 2FA is enabled, if so provide an access token. 如果启用了2FA,则提供访问令牌。
  4. Double check your permissions(username/password in configs) perhaps also try to use the format ' https://username@mydomain.org/project.git '' 仔细检查您的权限(配置中的用户名/密码),也许也尝试使用格式' https://username@mydomain.org/project.git
  5. Try ssh instead of https 尝试使用ssh而不是https

I am not sure, but have you already seen this link Can't clone a github repo on Linux via HTTPS ? 我不确定,但是您是否已经看到此链接无法通过HTTPS在Linux上克隆github存储库 It can give some extra information. 它可以提供一些额外的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM