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.
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
Check that Windows does not have a pending update. If it does, update and restart.
This worked for me:
Deleting the file %localAppData%\GitCredentialManager\tenant.cache and then re-trying your logon.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With