I installed Git on Windows 10 which also installed git-bash. When I started git-bash, I noticed I was not in my home directory which I expected to be /C/Users/chris/
The path was /C/adwHome
I found that git-bash home "~" is determined first by the environment variable HOME
. Another program on my system Cadence Allegro PCB Designer set the HOME environment variable to HOME=C:\adwHome
so I cannot change the HOME variable without breaking the other program.
The link Change the location of the ~ directory in a Windows install of Git Bash told me to add this line 'HOME="C:\Users\chris\git"' to my "profile" file located at C:\Program Files\Git\etc\profile
. This seemed to work because when I opened a new git-bash window I started in the correct directory.
However when I ran the ssh-keygen command I saw the output line Created directory '/c/adwHome/.ssh'.
I think git-bash is changing the home setting from the line in the file "profile" but any executable files launched by git-bash are still getting home set from the environment variable.
Is there a way to change my git-bash "~" location without changing my HOME environment variable?