0

If I got to Team Explorer in VS2017, and look at my repository settings, everything looks fine -- correct username, correct Remotes for Fetch and Push. However if I actually try anything -- fetch, push, etc. -- it fails and I get the error:

Error encountered while pushing to the remote repository: Git failed with a fatal error.

NullReferenceException encountered. Object reference not set to an instance of an object.

cannot spawn /c/program files (x86)/microsoft visual studio/.../git-askpass.exe: No such file or directory

could not read Username for 'https://myrepo.visualstudio.com': terminal prompts disabled

Pushing to https://myrepo.visualstudio.com/myproj/_git/myproj

However, if I open a command window to the project directory and simply do:

git push

everything works just fine.

VS2017 used to work just fine interfacing with Azure DevOps but it seems like I'm having all kinds of issues now. Did something change? Is there a way to get VS2017 working again?

RHarris
  • 10,641
  • 13
  • 59
  • 103

1 Answers1

0

Check the answer in case Visual Studio 2017 - Git failed with a fatal error:

  1. Delete folder (you can back up this folder in case you need to restore it): C:\Program Files (x86)\Microsoft Visual Studio\2017\xxx\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git

  2. Make sure that there is no version of Git installed on your system. Uninstall them in Control Panel / Uninstall a program once you have Git .

  3. Open up the Visual Studio 2017 installer and untick "Git For Windows" in installation options.

  4. Download the latest version of Git and install it.

  5. Go back into the Visual Studio 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.

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39