Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Team Services: Can log into github account, but can't push changes

I've been trying to set up github on my laptop via Visual Studio 2017 Team Services. It lets me sign in at first, and even let's me clone/fork repositories into a local folder. The problem is that every time I try to push back to github it comes up with this error:

Error encountered while pushing to the remote repository: Git failed with a fatal error. 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 Pushing to https://github.com/[username]/[repository name]

like image 966
Luke Weaver Avatar asked Mar 01 '18 20:03

Luke Weaver


1 Answers

This fixed it for me.

Navigate to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\ and delete the Git folder.

Make sure that there is no version of Git installed on your system, remove it by going to Control Panel > Program and Features (TortoiseGit does not need to be removed from my experience, just native git installations)

Open up the VS 2017 installer and untick "Git For Windows" in installation options.

Head over to the git website and install the latest version of Git For Windows.

Go back into the VS installer and tick "Git for Windows" again, it will not download a new version even though it may look like it is. After that is done your git should be fine with VSTS and TF Explorer.

ref: https://developercommunity.visualstudio.com/content/problem/27220/failed-to-push-remote-repository.html

like image 116
Mylonas K. Avatar answered Nov 15 '22 00:11

Mylonas K.