Git bash home directory different from Git extension than Git Bash

两盒软妹~` 提交于 2019-11-28 08:21:57
VonC

The git bash provided with msysgit in its repo is a script you can edit, in order to set HOME to %USERPROFILE%.
It is basically what it does by default, except if HOME is 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, HOME is 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 HOME is 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 HOME is set, for the Git bash, in etc/profile:

# Set up USER's home directory
if [ -z "$HOME" -o ! -d "$HOME" ]; then
  HOME="$HOMEDRIVE$HOMEPATH"
  if [ -z "$HOME" -o ! -d "$HOME" ]; then
    HOME="$USERPROFILE"
  fi
fi

I removed the first candidate home location, and it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!