Git 失败,出现 >致命错误.无法读取用户名 [英] Git failed with a > fatal error. could not read Username for

查看:16
本文介绍了Git 失败,出现 >致命错误.无法读取用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为这个问题苦苦挣扎了几天.

我无法从特定计算机(它在我的第二台 PC 上运行)连接到我的 Git 项目(存储在 VisualStudio.com 中).每当我尝试同步或克隆我的存储库时,VS2017 都会要求我提供用户凭据(两次),然后我收到以下错误:

<块引用>

错误:无法生成 askpass:没有这样的文件或目录错误克隆远程存储库时遇到:Git failed with a致命错误.无法读取用户名'https://.visualstudio.com':终端提示已禁用

不记得我是否更改了可能导致这种情况的任何内容...

解决方案

主要是Credential Manager记住了凭证造成的.您应该删除存储在凭据管理器中的 xxx.visualstudio.com 凭据.

如果电脑的操作系统是windows,你可以打开Credential Manager -> Windows Credentials -> Generic Credentials -> 删除像git这样的凭据:

然后再次克隆,git 会让你输入 repo 的凭证.输入可以访问VSTS账户的用户名(邮箱地址)和密码后,repo应该就克隆成功了.

I've been struggling with that issue for a couple days now.

I'm unable to connect to my Git project (stored in VisualStudio.com) from a specific computer (it works on my second PC). Whenever I try to Sync or Clone my repository, VS2017 asks for my user credentials (twice) and the I get the following error :

Error: cannot spawn askpass: No such file or directory Error encountered while cloning the remote repository: Git failed with a fatal error. could not read Username for 'https://.visualstudio.com': terminal prompts disabled

Can't remember if I changed anything that could've caused that...

解决方案

It’s mainly caused by the credentials have been remembered by Credential Manager. You should remove the credentials for xxx.visualstudio.com which have been stored in Credential Manager.

Such as if the pc’s OS is windows, you can open Credential Manager -> Windows Credentials -> under Generic Credentials -> remove the credentials like git:https://xxx.visualstudio.com.

Then clone again, git will let you input the credential for the repo. After inputing the username(email address) and password which can access the VSTS account, the repo should be cloned successful.

这篇关于Git 失败,出现 &gt;致命错误.无法读取用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆