Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change gitconfig location?

Tags:

git

windows

I am running this command under windows 7:

git status

Now I am getting this error:

fatal: unable to access 'H:\/.config/git/config

I am disconnected from the network at the moment. Can I still fix this by changing the config location or creating a new config?

like image 277
Pindakaas Avatar asked Feb 24 '15 07:02

Pindakaas


1 Answers

Can I still fix this by changing the config location or creating a new config?

You can simply change your environment variable HOME, in order to reference an existing local folder

set HOME=C:\local\path

In that folder, a .gitconfig can be defined in order to have a global git config file.

The msysgit/msysgit/git-cmd.bat defines it by default to:

@if not exist "%HOME%" @set HOME=%USERPROFILE%
like image 115
VonC Avatar answered Oct 13 '22 12:10

VonC