with - visual studio 2017 github tutorial

Attempting push on git and receiving “could not read Username for 'https://github.com': terminal prompts disabled” (5)

I'm using Visual Studio, and the GitHub Extension. I am able to sign in, then clone my team's repository, and then pull changes successfully.

When it comes time to push my changes back to remote, I get a blank command prompt appear on the screen briefly, and then the following errors in the output window:

Error encountered while pushing to the remote repository: Git failed with a fatal error.

fatal: AggregateException encountered. One or more errors occurred.

error: cannot spawn askpass: No such file or directory

fatal: could not read Username for 'https://github.com': terminal prompts disabled

EDIT: pushing via the command line works, as does pushing via the GitHub desktop application, just not within this extension.

Any ideas why this might be happening? I can't see why it needs the Username given that I have signed into the extension.

In my case the same issue coming on below scenario:

We are under corporate network. So we have our own proxy. When we try cloning we cant able to download due to same error.

I added proxy url in our git config.

 proxy=http://YourNameHere:[email protected]:6050/
 sslVerify = false

proxy=http://YourNameHere:[email protected]:6050/
 sslVerify = false

Issue disappears and i can do all git operations.

As per my comment. You can include your username in the remote URL (similar to FTP).

Example without password (SSH):

git remote set-url origin [email protected]/username/repo.git

Example with password (https)

https://name:[email protected]/username/repo.git

Source: Git push requires username and password

Updated 5/14/2018 to correct github.org to github.com in the original answer

I faced the same issue after I have only TLS1.2 enabled on my PC. After enabling TLS 1.1, SSL.x the issue was resolved. For enabling and disabling I used IISCrypto software. Hope that helps the team and other users.

In windows go to credentials manager and check if generic credentials list has the below entries



If these entries are not present add these entries with username and password and it should work.

What worked for me was to disconnect from all the existing connections in Visual Studio, remove them one-by-one and connect from scratch. Then immediatelly I was able to clone the repository again.