【发布时间】:2016-11-23 16:57:11
【问题描述】:
我是 git 新手,我正在尝试从 here 安装 git 2.9.2。在安装(众多安装中的最后一个)中,我选择仅从 bash 运行它。我现在尝试设置它,我尝试的第一件事是设置我的名字
$ git config --global user.name "My Name"
但是在我执行这个之后,我得到:
fatal: unable to access 'C:\Program Files\Git\ C:\Windows\system32\config\systemprofile/.config/git/config': Invalid argument
假设我现在要克隆一个存储库。我插入如下内容:
git clone https://username@bitbucket.org/team/repo.git
但我明白了:
fatal: unable to access 'D:\TestRepo\ C:\Users\username/.config/git/config': Invalid argument
我以为.gitconfig文件应该在C:/Users/username目录下,但它试图定位C:\Users\username/.config/git/config,这似乎有点奇怪。我的 HOME 变量应该是 %USERPROFILE%。任何帮助表示赞赏。
【问题讨论】:
-
好吧,试着按照 git 命令
git config --global core.autocrlf = true运行,然后告诉我你得到了什么输出。 -
我得到'致命:无法访问
C:\Program Files\Git\ C:\Users\username/.config/git/config: Invalid argument' -
您是否以管理员权限运行它?
set HOMEPATH输出什么? -
我做了,没有任何改变。
set HOMEPATH按预期返回HOMEPATH=\Users\username。我也尝试手动创建一个C:\Users\username/.config/git/config/.gitconfig空文件,但没有任何改变。 -
这很奇怪,尝试从系统中完全删除git并重新安装它
标签: windows git bash windows-10