If i run Git bash from Git Extention (CTRL+G), my home directory is %USERPROFILE%, which is ok.
If I run Git bash from the context menu of a git repo folder, or if I run Git bash from the start menu, my home directory is %HOME%, which is different.
How can I set up git bash to always use %USERPROFILE% as home directory (I have the .ssh folder within) ?
If it can help, on git bash run from Git Ext, I have :
$ echo $HOME
/c/Users/mylogin
Same command on git bash run directly :
$ echo $HOME
/h
h: is my corporate home directory
What can I do ?
The git bash provided with msysgit in its repo is a script you can edit, in order to set
HOMEto%USERPROFILE%.It is basically what it does by default, except if
HOMEis already defined, the git bash script won’t modify that value (but you can, if you edit said script).I suspect that, in your corporate environment,
HOMEis defined to a network drive, in order for various configuration files (maven, ssh, …) to be stored on a remote, secure and backed-up drive.That would explain why
HOMEis not changed by the Git bash script.The Git Extension obviously isn’t as careful as the first script, and will change/define whatever value it needs.
As the OP Steve B comments:
The
HOMEis set, for the Git bash, inetc/profile: