By default on Windows Git places global .gitconfig in c:\\documents and settings\\user\\
How can I change that position so .gitconfig is stored in
Solution without having to change Windows HOME variable
OS: Windows 10
git version: 2.27.0.windows.1
I use portable version of Git, so all my config files are on my pen-drive(E:). This is what worked for me:
.gitconfig and other bash files in E, so I created a folder called home where I want them all in.mkdir homeHOME="E:\git\home"Now it no longer searches in the C:\Users
$ git config --global --list
fatal: unable to read config file 'E:/git/home/.gitconfig': No such file or directory
It gave an error because there isn't a .gitconfig file there yet. This is just to demonstrate that we have successfully changed the location of the .gitconfig file without changing the HOME directory in Windows.