git commit 和用户身份

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15392575/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 15:44:30  来源:igfitidea点击:

git commit and user identity

git

提问by Germano Massullo

I am following the official guide of GIT, and actually I am at 2.2.6 paragraph " Committing Your Changes" Previously, at section 1.5.1 "Identity" when asked to enter a command like

我正在遵循 GIT 的官方指南,实际上我在 2.2.6 段“提交您的更改”之前,在第 1.5.1 节“身份”中被要求输入类似命令

git config --global user.name "John Doe"

I missed the --global option because I don't need it. Now everytime I do a git commit, I obtain

我错过了 --global 选项,因为我不需要它。现在每次我做一个 git commit,我都会得到

$git commit

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

but I do not want to enter a --global option, does exist another way?

但我不想输入 --global 选项,是否存在另一种方式?

回答by Dan McClain

If you just want to set it for that repository, run:

如果您只想为该存储库设置它,请运行:

git config user.email "[email protected]"
git config user.name "Your Name"

回答by Grace Nikole

Just type the same name that you have in your GitHub account, the same the same letters and character.

只需输入与您在 GitHub 帐户中相同的名称,相同的字母和字符即可。

GitHub account name

GitHub 账户名

git user.name

git 用户名