Adding PATH variable for git and gitbash to work on Windows
SYSTEM PATH Variable
You will need administrator on the local box – to set the SYSTEM PATH variable as shown below
- Click on Advanced System Settings.
- Click on Environment Variables.
- Under System Variables, look for the path variable and click edit.
-
Add the path to git’s bin and cmd at the end of the string like this: ;C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd.
Gitbash shortcut using HOME as an Environment variable
Define a new ‘%HOME%’ variable. And update your shortcut to use this variable
Click this and define a new variable, HOME
, with the value set to your working directory (e.g. c:\MYWINDOWSDIR\workspace\repo
).
Update the gitbash shortcut to use this new variable %HOME%
. Right click your gitbash shortcut and click Properties. Change the value of ‘Start in:’ field to %HOME%
. Click OK.
Summary
That’s it.
Hi sir,
Could you please tell what value would go in for git root Directory with the variable GIT_HOME?