使用git:询问user.email时,您可以放入任何电子邮件吗? [英] Using git: when asking for user.email, you can put any email?
问题描述
我是刚接触git的人,而配置git的第一件事就是
I'm new to understanding git, and one of the first things you do to configure your git are
$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"
事实证明,您可以放入任何电子邮件,一旦提交并将文件推送到Github,Github会以某种方式找到与电子邮件相关联的用户,并声称是该用户在回购记录的历史记录中进行了提交.如果您甚至无法验证git email实际上就是您,这有什么意义?
It turns out, you can put any email in, and once you commit and push your files into Github, Github somehow finds the user associated with the email and claims it is this user that did the commmit in the in the repo's history. How does this make sense if you can't even verify that git email is actually you.
但是,我了解到在您执行任何操作之前,您需要通过Github用户和密码确认您可以访问回购权,因此,在大方案中,除了作者的主张外,它不会产生太大影响在提交历史记录中.
However, I understand that before you can push anything, you need to confirm through Github user and password that you can access rights to the repo, so in the big scheme, it won't affect much, other than the author's claim in the commit history.
推荐答案
如果您甚至无法验证git email实际上就是您,这有什么意义.
How does this make sense if you can't even verify that git email is actually you.
因为您被允许代表任何其他用户推送提交.工作流程示例:
Because you're allowed to push commits on behalf of any other users. Example workflow:
- 您在
master
分支中创建一个或几个提交. - 您从上游存储库中将一些提交拖入
master
分支.这些提交是由另一个或多个用户创建的. - 您将
master
分支推到origin
.请注意,您推送了许多提交,包括那些不是由您创建的提交,origin
(无论它是什么)都必须接受所有提交.因此,没有电子邮件验证.
- You create one or few commits in
master
branch. - You pull a few commits into the
master
branch from an upstream repository. These commits have been created by another user or users. - You push the
master
branch toorigin
. Please note you push many commits including those that were not created by you andorigin
— whatever it is — must accept all of them. Hence there is no email verification.
如果您想对提交进行身份验证,则可以使用OpenPGP对它们进行数字签名.
If you want to authenticate commits you can digitally sign them using OpenPGP.
这篇关于使用git:询问user.email时,您可以放入任何电子邮件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!