美文网首页
git—为不同的项目设置不同的Git账号

git—为不同的项目设置不同的Git账号

作者: APHOME_明 | 来源:发表于2018-05-15 21:38 被阅读0次

*** Please tell me who you are.

Run

git config –global user.emailyou@example.com
git config –global user.name “Your Name”

to set your account’s default identity.
Omit –global to set the identity only in this repository.

fatal: unable to auto-detect email address (got ‘Administrator@SC-201712281921.(none)’)

单独为项目配置的方法(全局和单独配置都存在的时候会默认使用项目单独配置的):

1.打开项目所在目录,找到隐藏的.git文件夹。注意这个文件夹是隐藏的,显示隐藏出来就行。

2.打开文件夹里的config文件,推荐用nodepad++打开。

3.添加这三行到文件:

[user]
name = XXX(自己的名称)
email = XXXX(邮箱)
当然也可以通过命令行的方式,只需要在 .git 文件夹下。 例如执行如下命令:

git config user.name "xxxxx"

相关文章

网友评论

      本文标题:git—为不同的项目设置不同的Git账号

      本文链接:https://www.haomeiwen.com/subject/kkzydftx.html