问题
I use Git with Visual Studio 2017. Since yesterday every time I try to push or pull from the remote repository with Team Explorer I get the following error:
Git failed with a fatal error.
HttpRequestException encountered.
An error occurred while sending the request.
HttpRequestException encountered.
An error occurred while sending the request.
cannot spawn askpass: No such file or directory
could not read Username for 'https://github.com': terminal prompts disabled
回答1:
I have had this issue with my team on several different machines with several different users. We solved it with a single git command that sets the windows credentials globally to the credential.helper explained here
git config --global credential.helper wincred
After we fired off the above command, all clones, pushes and pulls worked like a charm. You would just have to make sure that the credentials you have stored in Windows Credentials are the ones that you want to use.
回答2:
This is very likely due to GitHub turning off versions of TLS older than 1.2. Visual Studio 2017 and Git for Windows have both been updated. More information can be found here:
https://developercommunity.visualstudio.com/content/problem/201457/unable-to-connect-to-github-due-to-tls-12-only-cha.html
Hope this helps!
回答3:
I encountered this problem some time ago and I can confirm that just upgrading to GCM 1.14.0 worked for me Get version v1.14.0 here
回答4:
Updating Visual Studio to the latest version worked for me.
来源:https://stackoverflow.com/questions/48952151/cant-pull-or-push-with-team-explorer-in-visual-studio-2017