Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git failed with a > fatal error. could not read Username for

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

like image 354
danbord Avatar asked Dec 27 '17 20:12

danbord


People also ask

How do I fix git failed fatal error?

git", instead of "https://github.com/user/Repo.git". To fix that, go to Team Explorer → Settings → Repository Settings → Remotes → Edit, and change "git@" to "https://" and ":" to "/". Save this answer.

How do I stop typing and username in git?

Entering Git Username and Password in Remote URL To prevent Git from asking for your username and password, you can enter the login credentials in the URL as shown. The main drawback of this method that your username and password will be saved in the command in the Shell history file.


1 Answers

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.

enter image description here

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.

like image 57
Marina Liu Avatar answered Sep 19 '22 09:09

Marina Liu