I am using PowerShell on Windows 10.
PS Z:\> git config --global --edit
fatal: cannot create configuration file Z://.gitconfig: Permission denied
PS Z:\> echo $HOME
C:\Users\joseph64
PS Z:\> git --version
git version 2.36.1.windows.1
Everything I can find about config paths (e.g., Where is the global git config data stored?, First-Time Git Setup) is telling me that it should be looking for ~/.gitconfig. Where is it getting Z:
from?
If I use cmd
instead of PowerShell, I can see HOMEDRIVE=Z:
and HOMEPATH=\
, which at least makes the behavior of Git make sense. But that doesn't explain why Git behaves the same in PowerShell where only HOME
is defined.
If I cannot convince Git to look for config files in my actual home directory, is there another way to configure global settings?