Can't login to GitHub
NOTE: Updating to Visual Studio 2017 15.5.7 or later should fix this. See https://github.com/github/VisualStudio/issues/949#issuecomment-367821388
I'm having some trouble logging on to GutHib to push new changes to my repository. I've just recently upgraded to Visual Studio 17. Everything used to work on VS 2015, but doesn't any longer.
- GitHub Extension for Visual Studio version: 2.2.0.8
- Visual Studio 2017 Professional: Ver 15.0.0+26228.9
- Windows 7 Pro SP1
Detailed steps:
- I have a local clone of a public (personal) repository. I've made changes to the local files
- Staged the changes.
- Attempted to push the changes.
- The GitHub login dialog appears. I've entered my username and password. I've confirmed that these are correct by logging in to the website.
- I get the following in my ouput pane on Visual Studio
Opening repositories:
### Local path, removed the actual path to anonymise ###
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
Pushing to https://github.com/### repo path ###.git
I have 2 factor enabled on my account.
Yes, the update fixed this.
Updating fixed it here too.
Updating also fixed it here, thanks.
15.7 is a winner!
thank you @meaghanlewis and @nimad !! GitHub was working just recently with 15.5.6 - the update today to 15.5.7 helped tremendously for the error: cannot spawn askpass: No such file or directory message today!
In the future regarding breaking changes a better error message along the lines of security settings invalid would be better instead of cannot spawn askpass: No such file or directory which caused me to spend wasted time trying to debug what I assumed to be a corrupted install (because since when do executable suddenly vanish normally?).
@avelis26 update to 15.5.7 to fix
I saw that and thanks... that worked.
-1: No admin rights - cannot install any updates... should work - no sysadmin wide and far - f****d ...
git remote set-url origin username:[email protected]/username/repo.git
is therefore what works for me. Note: this will store your github-pw as plaintext in ./.git/config
Thanks github, now I'm that much safer... - love you PS: that's sarcasm
@microsoft: Why does TLS 1.2 need a Visual Studio Update ? :bomb: :bomb: :bomb:
Thanks @nimad, updating my VS worked.
Thanks everybody! Now it works!
I Work To 2:00 AM,Tell me ,because version Question ? what?????
The issue here is that Visual Studio bundles their own git.exe and (based on the above comments) the version prior to 15.5.7 was a piece of junk. I have git 2.16-x64 installed so I don't need their version. The fix for me (without updating to 15.5.7) was to delete this folder --
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git
Followup on my previous post ... If you can't install the update right now..
GoodGit = C:\Program Files\Git
BadGit = C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git
BadGit is found first by visual studio, unless you edit your visual studio options and remove the CommonExtension folder from the search path.
[C:\]dir git.exe /s/b/a
C:\Program Files\Git\bin\git.exe
C:\Program Files\Git\cmd\git.exe
C:\Program Files\Git\mingw64\bin\git.exe
C:\Program Files\Git\mingw64\libexec\git-core\git.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin\git.exe
After deleting the bad git folder, make sure running git.exe from the command prompt finds the correct version via the system path.
[C:\]git --version
git version 2.16.2.windows.1
But probably the right way to do it would be to remove git from this section of Tools-->Options, seen here.

This issue was fixed for me by updating to the latest 15.5.7 and installing the Git For Visual Studio extension again. Sorry I don't have more specifics! It was as easy as it sounded.
GitHub Extension 2.4.2.1331 VS 2017 15.5.7
And getting this when trying to do commits now. I've been able to push without issues until today. Not sure what's changed. Still investigating.
A task was canceled. cannot spawn askpass: No such file or directory could not read Username for 'https://github.com': terminal prompts disabled
UPDATE: I installed the Git Cred Manager, didn't fix it. I deleted my GitHub login in the Cred Manger in Control Panel under Web and so far I've been able to make commits.

Because we're not running on the command line this fails with error: cannot spawn askpass: No such file or directory, which is a very unhelpful error message.
Also in this department of unhelpful error messages, I love that this reports the exception type name instead of the exception message, stack trace, or something actually meaningful.... "AggregateException encountered" =<
@StingyJack: That's all the info you get on the command line. No stack trace. And yes, the error message is very unhelpful. That has something to do with the programmer, though, not the reporter.
In fact, sometimes it just outputs nothing at all (while it says "look in the output tab") - but still fails - seems to be a visual studio issue, too. Sometimes message, sometimes blank. Same error. That's like when you switch to the "error tab" and look for compiler error 1 of 0.
Also in this department of unhelpful error messages, I love that this reports the exception type name instead of the exception message, stack trace, or something actually meaningful.... "AggregateException encountered"
Yes I agree, the error message is not helpful. I'm tagging some of the Team Explorer people here so they're aware of this thread: @kaylangan @clboles @jeremyepling
Thanks for everyone's input on this!
Could commit but couldn't push. Upgraded Git for Visual Studio and didn't help. Then upgraded to VS 15.5.7 and it worked again.