更改GitHub用户名时提交归因? [英] Commit attribution when changing GitHub username?

查看:54
本文介绍了更改GitHub用户名时提交归因?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我愿意更新GitHub用户名,使其与其他网站和社交媒体更加一致和可识别.

I'm willing to update my GitHub username to be more consistent and recognizable with other sites and social media.

根据 GitHub文档

与您的GitHub提供的noreply电子邮件地址相关联的Git提交不会被归属到您的新用户名,也不会出现在您的贡献图中.如果您的Git提交与您已添加到GitHub帐户的另一个电子邮件地址(包括基于GitHub的GitHub提供的noreply电子邮件地址)相关联,则它们将继续归因于您,并在您完成后显示在您的贡献图中更改了您的用户名.有关设置您的电子邮件地址的更多信息,请参阅设置您的提交电子邮件地址".

Git commits that were associated with your GitHub-provided noreply email address won't be attributed to your new username and won't appear in your contributions graph. If your Git commits are associated with another email address you've added to your GitHub account, including the ID-based GitHub-provided noreply email address, they'll continue to be attributed to you and appear in your contributions graph after you've changed your username. For more information on setting your email address, see "Setting your commit email address."

究竟是什么意思?如果我理解正确,如果我更改了用户名,我的提交将不再归因于我吗?不回复电子邮件地址"的正确含义是什么?和基于ID的不答复电子邮件地址"?如何确定我的提交是否与一个或另一个关联?

What does exactly means? If I understand it correctly, if I change my username, my commits won't be attributed to me anymore? What is the correct meaning of "noreply email address" and "ID-based noreply email address"? How can I find if my commits were associated to one or another?

换句话说,如何在更改用户名之前检查是否会丢失提交属性?

I other words, how can I check if I would lose my commit attributions before changing my username?

请注意,我在本地工作,并且 git config --list |grep email 给了我 user.email =< my-real-email> @ gmail.com .

Please note that I work locally and that git config --list | grep email gives me user.email=<my-real-email>@gmail.com.

推荐答案

其他答案大多可以回答问题,但还有其他注意事项.即使您一直在使用GitHub的不答复电子邮件地址,也可以将提交归因于新用户名,具体取决于地址.这些文档中的关键段落如下:

The other answer mostly answers the question, but there's an additional consideration. You can have your commits attributed to your new username even if you had been using GitHub's no-reply email address, depending on what the address looked like. The key paragraphs in the docs are these:

注意::如果您在2017年7月18日之后创建了GitHub帐户,则GitHub提供的 no-reply 电子邮件地址是一个七位数的ID号和您的用户名以 ID+username@users.noreply.github.com 的形式.如果您在2017年7月18日之前创建了GitHub帐户,则GitHub提供的 no-reply 电子邮件地址就是您的用户名,格式为 username@users.noreply.github.com .您可以通过在电子邮件设置中选择(或取消选择并重新选择)将我的电子邮件地址设为不公开,来获取基于GitHub的GitHub提供的ID的电子邮件地址.

Note: If you created your GitHub account after July 18, 2017, your GitHub-provided no-reply email address is a seven-digit ID number and your username in the form of ID+username@users.noreply.github.com. If you created your GitHub account prior to July 18, 2017, your GitHub-provided no-reply email address is your username in the form of username@users.noreply.github.com. You can get an ID-based GitHub-provided no-reply email address by selecting (or deselecting and reselecting) Keep my email address private in your email settings.

如果您使用GitHub提供的 noreply 电子邮件地址进行提交,然后更改用户名,则这些提交将不会与您的GitHub帐户相关联.如果您使用的是基于ID的GitHub提供的 noreply 地址,则此方法不适用.有关更多信息,请参阅更改GitHub用户名".

If you use your GitHub-provided noreply email address to make commits and then change your username, those commits will not be associated with your GitHub account. This does not apply if you're using the ID-based GitHub-provided noreply address. For more information, see "Changing your GitHub username."

较旧的不答复地址基于用户名,因此与您的GitHub用户名相关联.如果您的提交使用了这样的地址,那么它们将继续被归因于旧的用户名,而不会切换到新的用户名.如果以后有人使用旧的用户名,则这些提交将归因于该用户.

Older no-reply addresses were username based, and so were tied to your GitHub username. If your commits used such an address, then they would continue to be attributed to the old username and would not switch over to your new username. If someone later takes the old username, those commits will get attributed to that user.

自2017年7月18日起,GitHub通过在无回复地址中添加ID 更改了此功能.该ID现在已与您的帐户相关联,并且不与您的用户名关联.如果您有一个基于ID的地址,则更改用户名仍会将该地址的所有提交归于您.但是,如果您在发布基于ID的地址之前开始使用GitHub的no-reply电子邮件功能,则您将继续使用旧的地址格式,除非您明确地重新选择了该选项,如注释所述.

Since July 18, 2017, GitHub changed this feature by adding an ID to the no-reply address. This ID is now associated to your account, and is not tied to your username. If you had an ID-based address, changing the username still attributes all the commits from that address to you. However, if you started using GitHub's no-reply email feature before the ID based address was released, you would have continued using the old form of the address unless you explicitly reselected the option, as the note says.

总而言之,在以下情况下,用户名更改后,提交将继续归因于您的帐户:

To summarize, commits will continue to be attributed to your account after a username change, if:

  1. 提交使用与您的GitHub帐户关联的电子邮件地址.
  2. 该提交使用了GitHub提供的基于ID的无回复电子邮件地址.

这篇关于更改GitHub用户名时提交归因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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