Visual Studio 2017 ships with its own version of Git. Unfortunately, it doesn't have support for SSH and it doesn't include a root certificate for the issuer for SSL certificate protecting our repositories. So, whenever we try to clone, pull, or push, we get this error:
Error encountered while cloning the remote repository: Git failed with a fatal error. fatal: unable to access 'https://********/': SSL certificate problem: unable to get local issuer certificate
It looks like Visual Studio 2017 ships with its own version of Git. The latest version of Git, 2.12.2, fixes the issue above by adding support for looking in the Windows Certificate stores when validating SSL certificates. Is there anyway to configure Visual Studio to use the globally installed version of Git? Bonus points if the solution works across versions of Visual Studio.
Step 1: Go to the Settings in vscode. Step 2: Open settings. json. Step 4: just add the directory path where git is installed in your system.
Visual Studio has Git tooling built directly into the IDE, starting with Visual Studio 2019 version 16.8. The tooling supports the following Git functionality: Create or clone a repository. Open and browse history of a repository.
1 Answer. If on windows, the default path is C:\Program Files (x86)\Git. The name of the executable is not git.exe for all systems.
You can check whether Git is installed and what version you are using by opening up a terminal window in Linux or Mac, or a command prompt window in Windows, and typing the following command: git --version.
This may be a little bit late but just in case others come looking for this information and end up here, you can tell Visual Studio 2017/2019 to use the system installed version of Git by doing the following:
$(DevEnDir)\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd
$(DevEnDir)\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin
Please note this screenshot was found on google because I don't have my computer on me for actual screenshots. So it may appear a bit different.
Replace these with the location of your system installed version of git.
Example of step five would be something like:
C:\Program Files\Git\bin
C:\Program Files\Git\mingw64\bin
Finally, you will need to completely close down Visual Studio. I would recommend an actual restart just to play it safe because sometimes it doesn't see those changes even after re-opening Visual Studio.
The Visual Studio installed Git version was causing issues on my side too, so I've replaced the entire folder where Visual Studio deploys its own version:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\
With the last 32-bits version downloaded from here. And after restarting the IDE the issues has gone, an option to change this from Visual Studio settings would be welcome, but at least this workaround works.
Visual Studio 2019 and above
The newer versions of Visual Studio uses directly the Git client installed on Windows, you can update it easily from command prompt using the following instructions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With