Wednesday, November 29, 2017

windows - How can I add git.exe to Visual Studios command line path?

I've just set up a new computer. When I installed Visual Studio I didn't install Git because I don't want to use it from within VS. Instead I installed Git for Windows. However, a script we use to build the project uses git, and it runs the MSVC command line, so as it turns out, I need the VS command line's PATH variable to contain the folder where git.exe is located.



'git' is not recognized as an internal or external command, operable
program or batch file.



I've tried uninstalling Git for Windows and starting the VS installer again, hitting Modify and then adding Git and Github, but that didn't help.


Here's a similar question but the answer is to set the path from the command line, something I don't want to do. Adding an environment path to the Visual studio command prompt


Update Hmm, actually I'm not sure if it's the VC command line. Is there a way to find out? Because %PATH% contains the git folder on BOTH the "normal" Windows command line AND with the one in MSVC tools (though there are more than one). But not when I'm running our build tool, for some reason. It's more like VS cmd's path than Windows's but it lacks the git path.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...