GitHub 贡献图表如何计算提交?

How are commits counted by the GitHub contributions graph?

如何计算个人资料上 GitHub 贡献图表中的贡献? (带绿点的那个。)提交是否被计算是否取决于提交中的用户名,或与之关联的电子邮件?

请提供详细信息。有什么方法可以将提交与我的用户名相关联,但更改我的电子邮件并且仍然显示绿点?

GitHub 在他们的网站上有一篇关于此的文章。参见Why are my contributions not showing up on my profile?关于提交,文章说:

Commits

Commits will appear on your contributions graph if they meet all of the following conditions:

  • The commits were made within the past year.
  • The email address used for the commits is associated with your GitHub account.
  • The commits were made in a standalone repository, not a fork.
  • The commits were made:
    • In the repository's default branch (usually master)
    • In the gh-pages branch (for repositories with Project Pages sites)

In addition, at least one of the following must be true:

  • You are a collaborator on the repository or are a member of the organization that owns the repository.
  • You have forked the repository.
  • You have opened a pull request or issue in the repository.
  • You have starred the repository.

您可以将多个电子邮件地址与 email settings page 中的 GitHub 帐户相关联。

确保在本地配置中设置您的电子邮件。

git config --global user.name "kimcrab"
git config --global user.email "kimcrab89@gmail.com"

有关详细信息,请参阅 Common reasons that contributions are not counted

  1. 提交时间不到 24 小时;
  2. 您的本地 Git 提交电子邮件未连接到您的帐户;
  3. 未在默认或 gh-pages 分支中提交;
  4. 提交是在分叉中进行的;