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, but I am also 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 is planning to resolve this issue.