Visual Studio 2017 - Git failed with a fatal error

Toby picture Toby · Mar 8, 2017 · Viewed 195.1k times · Source

I am using Visual Studio 2017 Community Edition (CE), and I have signed into my Microsoft account and I am connected to VSTS. I can see all my projects and repositories, but when I attempt to pull/fetch/push any changes I get the following error:

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

And accordingly for the fetch and pull commands too.

I installed Git for Windows on the Visual Studio 2017 installer and not only is it failing to work with VSTS, I am unable to work with any of my GitHub repositories too. Has anyone else noticed this? It's happened on two of my machines so far.

Visual Studio 2015 Enterprise Edition (EE) and CE work completely fine for me.

It seems that this issue has gotten far more recognition that I thought it would which leads me to believe that this is an issue with how Visual Studio is dealing with Git. I have also noticed that every time I update Visual Studio, this problem pops back up, and I have to go through the steps in some of the answers below to get Git working again. I'm not sure why this is happening, and I also don't know if Microsoft are planning to resolving this issue.

Answer

wbing520 picture wbing520 · Jun 8, 2018

After I changed the generic credentials from Control PanelUser AccountsCredential Manager for Git, it worked for me.

Enter image description here