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
git commit and user identity
提问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"