Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is Visual Studio's git.exe location?

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?

like image 484
Grigoryants Artem Avatar asked Sep 12 '19 10:09

Grigoryants Artem


People also ask

Where is my git exe path?

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.

Where is git path in Vscode?

Open setting. json(or File>Preferences>Settings). Navigate to Workspace Settings. Find "Path" and add paths to Git bin and cmd folders.

Is git installed with Visual Studio?

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.

How do I know if git is installed Vscode?

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.

How do I view git in Visual Studio?

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.

How do I run a git command in Visual Studio?

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.


2 Answers

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).

like image 97
WSLUser Avatar answered Nov 15 '22 18:11

WSLUser


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
like image 30
Adrian Mole Avatar answered Nov 15 '22 20:11

Adrian Mole