Visual Studio 2017 - Git failed with a fatal error
Solution 1
After I changed the generic credentials from Control Panel → User Accounts → Credential Manager for Git, it worked for me.
Solution 2
I'm going to add a solution here that the previous answers have not already mentioned, but this is what fixed it for me.
Navigate to
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\
and delete theGit
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 Visual Studio 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 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.
Solution 3
I had a different problem. My computer contained older OpenSSL DLL files in system32 and syswow64 so to fix my problem, I had to copy libeay32.dll
and ssleay32.dll
from one folder to another folder within the Git folders of Visual Studio 2017.
FROM: C:\Program Files (x86)\Microsoft Visual Studio\2017\
vs_edition\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin\
TO: C:\Program Files (x86)\Microsoft Visual Studio\2017\
vs_edition\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core
Ref.: Git - Can't clone remote repository
Solution 4
In Control Panel\All Control Panel Items\Credential Manager
==> Windows Credentials
Remove Git:http://........
and Retry..
Enjoy !
Solution 5
I tried a lot and finally got it working with some modification from what I read in Git - Can't clone remote repository:
Modify Visual Studio 2017 CE installation → remove Git for windows (installer → modify → single components).
Delete everything from
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git
.Modify Visual Studio 2017 CE installation → add Git for windows (installer → modify → single components)
Install Git on windows (32 or 64 bit version), having Git in system path configured.
Maybe point 2 and 3 are not needed; I didn't try.
Now it works OK on my Gogs.
Related videos on Youtube
sham
Updated on July 09, 2022Comments
-
sham almost 2 years
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.
-
GorvGoyl about 7 yearsdid u find any solution?
-
Royi Mindel almost 7 yearstry going to the solution folder in cmd and using git push to see the actual error, I had the same issue, tried many thing, the command line gave me the actual reason for the failure (I marked my email as private in github and it was conflicting with the push details as it would make my email visible in the code change)
-
Daniel Bailey over 5 yearsI was also getting all sorts of errors, fixed them all by just updating the GitHub extension in
Tools > Extensions & Updates
.
-
-
Bill Noel about 7 yearsI have two machines. Both have VS2017RTM on them. Same version of VS and same version of GitHub.VisualStudio. Neither TeamExplorer folder has a Git folder in it. One works and one doesn't. :(
-
StingyJack about 7 yearsThis worked for me, but where the heck did you find the clue?
-
cvocvo about 7 yearsSame trick works for 'Professional', copy the dll's, close VS instances, reopen one and try to close again.
-
Riki about 7 yearsThose were not the only files that were missing for me. This link describes how to find out what you have to copy. developercommunity.visualstudio.com/content/problem/27220/…
-
tsalaroth about 7 yearsThis may well be the solution we're all looking for! Thank you!
-
Ogglas almost 7 yearsWorked for me, Error:
Error encountered while cloning the remote repository: Git failed with a fatal error. CloneCommand.ExecuteClone
-
benichka almost 7 yearsWorked for me, but just after 1 I also uninstalled Git for Windows in the program list for my PC.
-
SvenAelterman almost 7 yearsThis was my problem too. I had to uncheck the
Block command line pushes that expose my email
setting, push commits that were pending. Then I configured my GitHub no-reply email address in git global config. Any future commits were then associated with that email and can now be pushed even with theBlock command line pushes that expose my email
turned on again. -
Lance Larsen - Microsoft MVP almost 7 yearsAwesome, totally worked - wouldn't have thought of this in a million years - huge kudos!
-
jaredbaszler over 6 yearsMine was similar to this. I was having an issue where the newer version of VS 2017 (15.3.2) was all of a sudden constantly making me check in this odd storage.ide file. I had to keep committing that file after closing/opening VS and that finally worked. Disclaimer - I also completed the steps in the most accepted answer above as well.
-
Jude over 6 yearsI just noticed that all files I committed, was still under "Changes". I recommitted them. And problem's gone away.
-
Tomas Dittmann over 6 yearsI already had git for windows installed. Executing step 1 and step 5 did it for me.
-
PhatBuck over 6 yearsAhem - or Enterprise instead of Community in the above path ;-)
-
Tun about 6 years@Douglas you're absolutely right. I followed what you mentioned. It fixes the problem.
-
Esen about 6 yearsThank you this solved my issue. I changed my domain username password and before I did, i had uncommitted changes. When used git pull, it shows change username password popup which helped me understand what was the problem. Then I did git reset to lose all the previous change and then it solved my problem in Visual studio
-
qxotk almost 6 yearsOn Step 4 - does it matter whether one installs 32-bit of 64-bit Git for Windows?
-
qxotk almost 6 yearsOn Step 4 I used 64-bit Git for Windows and this worked for me. My VS2017 15.7.3 can once again push to my remote without getting this error.
-
Peter Mortensen almost 6 yearsRe TF Explorer: Do you mean Team Explorer?
-
user15741 almost 6 yearsGit OpenSSL or native Windows Secure Channel?
-
Steve Kennedy almost 6 yearsThis worked for me. Seemed like the easiest of all the suggested solutions too.
-
Steve Kennedy almost 6 yearsThis worked for me. Seemed like the easiest of all the suggested solutions too
-
wbing520 almost 6 yearsGlad it helps. Could you please vote it if it helps? It may help others. Thanks!
-
HackSlash over 5 yearsVS is incapable of making a new remote origin. This is the only thing that works for me. You do the initial push to the remote on the command line or with Tortoise and then VS can use it.
-
Enno over 5 yearsThis worked for me. So it looks like the version of Git that MS ships is bad, and replacing it with the official Git for Windows release fixes the problem - just make sure it's in the PATH, and the only version of git that is installed. I think we're finally migrating to VS2017.
-
CScott over 5 yearsSolved my issue as well. I was getting "Git failed with a fatal error. Authentication failed for <TFS path>". I deleted the git item from Credential Manager and was prompted for my new password next time I tried a push from VS
-
Sherwin over 5 yearsThanks for this. Solved my GIt issue in latest updated VS2017
-
Kundan Vuppala over 5 yearsI just removed the git links under generic credentials, it worked.
-
markzzz over 5 yearsThis seems to be the smartest solution! Thank you ;)
-
Anthony Elliott over 5 yearsWhile committing before reverting does prevent you from losing data, that doesn't answer the OP's question. That would be a good fit for a comment though!
-
Cᴏʀʏ over 5 yearsI'm here due to the flashing console windows issue that the steps above fix. Visual Studio 15.9.7 broke Git again, but this fix still works.
-
Guillermo Ruffino about 5 yearsAlso had Git already installed, just closed VS deleted git folder, restarted and everything was ok.
-
Rich about 5 yearsI'm not sure which step fixed the problem, but I did uninstall the older version of git that I had and installed the latest as well as the other steps you mentioned and now it works.
-
chiwal about 5 yearsTo get to
Credential Manager
just search for it in windows 10 (use the windows key). Then click Windows Credentials. Scroll down to the Generic Credential section and look forgit: https://your.tfs.server
. I received this error after changing my windows password. -
Alex almost 5 yearsWhy do you think that the issue in wrong creds? It will help only in one case but you'll receive another error. Thi doesn't solve problem
-
danbord almost 5 yearsAfter HOURS of struggling I finally found my solution here... Thanks a bunch! :D
-
ΩmegaMan over 4 yearsThe location of the credentials is in the
Windows Credentials
section now and notWeb Credentials
. Otherwise the proceeding steps are the same on Windows 10. -
Barumpus over 4 yearsFor me, all I needed was step 1. (VS 2017 Enterprise, already had git for windows installed.) I exited Visual Studio 2017 first, deleted that GIT folder, then reloaded VS 2017 and all was well. Removed
git
folder fromC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
-
Senura Dissanayake over 4 yearsThanks. Solved my Git issue in VS 2019
-
s.n over 3 years1. Remove the link as mentioned 2. RESTART Visual Studio!
-
Fadhly Permata over 3 yearsI have no idea why my old credentials stop working (I did not change any credentials), Thanks for saving my day.
-
SpaceUser7448 about 3 yearsWorked fine for me by only doing the first step, then it used the correct version of the GIT software
-
flatrick about 3 years@StingyJack I reported the issue to Microsoft together with a Procmon dump, and the supporter from Microsoft identified that it used the wrong dll. I never did find out exactly which application I had installed that had put its required version of libeay32.dll/ssleay32.dll in the system32 folder either..
-
bakalolo over 2 yearsChanged to what? Can you please clarify?
-
Doug over 2 yearsUnbelievable - I deleted the git folder here, but it worked! C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git
-
OAM over 2 yearsThis worked for me. Thanks a lot.