I'm configuring git through command line but changes seems doesn't apply to Visual Studio's git actions, so I'm wondering perhaps VS uses another git instance with other configs, where can I find which git.exe is getting used by VS?
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.
Open setting. json(or File>Preferences>Settings). Navigate to Workspace Settings. Find "Path" and add paths to Git bin and cmd folders.
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.
To verify, open the command prompt of windows by pressing the Windows key and R. Inside command prompt, type git — version to know the version of Git installed. If Git is not installed, the command prompt will return a message as shown in the image below.
The new Git experience is the default version control system in Visual Studio 2019 from version 16.8 onwards. However, if you want to turn it off, you can. Go to Tools > Options > Environment > Preview Features and then toggle the New Git user experience checkbox, which will switch you back to Team Explorer for Git.
Right click the solution and choose Open in Terminal. This starts a PowerShell instance which docks (by default) at the bottom of Visual Studio and can be used to invoke system git.
VS2019 appears to have a near full-blown install of Git for Windows hidden within it's installation. The only thing that appears to be stripped out of it is Mintty. So you can set the GIT_PATH
env var as well as GIT_SSH
just like in Git for Windows and use it via CLI as easily as using git in Visual Studio.
You can find the path here: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd
and here: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin
Set your path to the first one (this is what Git for Windows uses).
Visual Studio gets the location of the various git
tools from the config
file in the .git
folder, for example, in lines like this:
[difftool "vsdiffmerge"]
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
keepBackup = false
Other than that, the only place I can find a git.exe
on my PC is here:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin\git.exe
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