如何更改gitconfig位置? [英] how to change gitconfig location?
问题描述
我在windows 7下运行这个命令:
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?
推荐答案
仍然通过更改配置位置或创建一个新的配置来解决这个问题?
Can I still fix this by changing the config location or creating a new config?
只需更改环境变量 HOME
,以引用现有的本地文件夹
You can simply change your environment variable HOME
, in order to reference an existing local folder
set HOME=C:\local\path
在该文件夹中,可以定义一个.gitconfig以便拥有一个全局git配置文件。
In that folder, a .gitconfig can be defined in order to have a global git config file.
msysgit / msysgit / git-cmd.bat
默认将其定义为:
The msysgit/msysgit/git-cmd.bat
defines it by default to:
@if not exist "%HOME%" @set HOME=%USERPROFILE%
这篇关于如何更改gitconfig位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!