git全局配置问题 [英] git global config issue

查看:155
本文介绍了git全局配置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知何故,我的全局git(msysgit)设置为 user.name user.email 还有什么)被设置为最近一位前同事的详细信息。



当我尝试更改它们时,我得到无法提交给u:// .gitconfig



如果我尝试通过git创建 u://.gitconfig bash然后我得到权限被拒绝

  C:\Users\\ \\<我的用户名> \ 

不包含对git的引用。 b

我尝试卸载,在注册表和我的文件系统中搜索git的所有引用,但我找不到任何文件(windows文件搜索是垃圾)。



到底发生了什么?为什么即使重新安装后,这些家伙的细节仍然是全球性的设置???



谢谢

解决方案

全局gitconfig存储在 $ HOME 位置(在Git bash会话中)。

是否有可能您拥有 $ HOME (或DOS会话中的%HOME%)引用 u:\



如果是这样,只需 set HOME =%HOMEPATH%(如果您有 HOMEPATH 定义就像在Windows 7中一样),并且您应该能够恢复访问/更新您的全局Git配置。




OP增加:


<我的%HOMEPATH%设置为 \ ,会将 HOME 设置为帮助吗?



实际上不是,因为 HOME 不是通常由Windows(Xp,Vista或7)设置的环境变量。


修正了它,真棒,将HOME设置为 c: \\ users \me


这是正确的修复方法,虽然修复了 HOMEPATH (即使这并不直接涉及Git)也是可取的(它不应该引用 u:\ )。 p>

Somehow, my global git (msysgit) settings for user.name and user.email (and god knows what else) are set to a recent ex-colleague's details.

When I try and change them i get could not commit to u://.gitconfig

If I try and create u://.gitconfig through git bash then i get permission denied.

C:\Users\<My Username>\

contains no references to git.

I've tried uninstalling, searching the registry and my file system for all references to git and I can't find any (windows file search is crap though).

What the hell is going on? Why even after reinstalling are this guys details still the global settings???

Thanks

解决方案

The global gitconfig is store at the $HOME location (in the Git bash session).
Is it possible you have a $HOME (or %HOME% in DOS session) referencing u:\.

If so, simply set HOME=%HOMEPATH% (if you have HOMEPATH defined like in Windows 7), and you should be able to resume accessing/updating your global Git configuration.


The OP adds:

my %HOMEPATH% is set to \, will setting HOME to that help?

Well actually no, since HOME is not a environment variable usually set by Windows (Xp, Vista or 7).

fixed it, awesome, set HOME to c:\users\me

That is the right fix, although fixing HOMEPATH (even if that doesn't directly involve Git) would be also advisable (it shouldn't refer to u:\).

这篇关于git全局配置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆