Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attempting push on git and receiving "could not read Username for 'https://github.com': terminal prompts disabled"

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.

like image 870
Matt Avatar asked Mar 20 '17 23:03

Matt


4 Answers

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

like image 144
Taylor Ackley Avatar answered Nov 08 '22 07:11

Taylor Ackley


Check that Windows does not have a pending update. If it does, update and restart.

like image 33
Scott Avatar answered Nov 08 '22 09:11

Scott


This worked for me:

Deleting the file %localAppData%\GitCredentialManager\tenant.cache and then re-trying your logon.

like image 28
Anthony Avatar answered Nov 08 '22 07:11

Anthony


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

git:https://github.com

https://github.com

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

like image 3
user2713706 Avatar answered Nov 08 '22 07:11

user2713706