Locate the git executable
The first step is finding the path to folder that contains git.exe.GitHub for Windows installs to C:\Users\<User>\AppData\Local\GitHub which can be shortened to %USERPROFILE%\AppData\Local\GitHub. Within this folder is a sub-folder starting PortableGit.... such as PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c.
You can use a shortened name for this folder such as portab~1. To find this shortened name, navigate to the GitHub folder in the command prompt and run:
for /d %I in (*) do @echo %~sI
You might have to hunt around for the git.exe file in this folder. At one point I found it in a bin sub-folder but this appears to have changed recently to mingw32\bin (GitHub for Windows version 3.0.11).
My final path ended up being:
%USERPROFILE%\AppData\Local\GitHub\portab~2\mingw32\bin
Add to the system path
- Go to System Properties by opening the run dialog (Windows key + R) and opening 'control sysdm.cpl'
- Change to the Advanced tab and click on Environment Variables
- In the System variables section, click on Path and click Edit
- At the end of the value text add a semicolon and the path to the git executable
- Click OK, OK and OK to close System Properties
Restart Visual Studio Code and Git integration should now work.
No comments:
Post a Comment