git 未在 GitHub 上显示为贡献者
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40644933/
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
Not showing as a contributor on GitHub
提问by SirCipher
I'm struggling to get GitHub to show my contributions to a project. It is not my repository, but other repositories I've contributed to do show up on my profile.
我正在努力让 GitHub 展示我对项目的贡献。这不是我的存储库,但我贡献的其他存储库会显示在我的个人资料中。
I've tested contributions to both shared and private repositories work. I've pushed from other projects and everything is working as expected. The patches from the non-working project and a working one, both show the same details. Any pushes to working projects show me as a contributor on both the repository and my personal profile.
我已经测试了对共享和私有存储库工作的贡献。我已经从其他项目中推动,一切都按预期工作。来自非工作项目和工作项目的补丁都显示了相同的细节。任何对工作项目的推动都表明我是存储库和我的个人资料的贡献者。
git config --global user.email
and git config --global user.name
are both correct. The repository I am committing to shows me as the author, but not on my profile.
git config --global user.email
并且git config --global user.name
都是正确的。我承诺的存储库将我显示为作者,但不在我的个人资料中。
I'm a bit lost on what to do. Does anyone have any ideas?
我有点不知所措。有没有人有任何想法?
采纳答案by SirCipher
Few things might lead to you not being able to see your own contributions to another person's git repository.
很少有事情会导致您无法看到自己对他人 git 存储库的贡献。
The owner of the repository may not have merged your branch yet, if so, you may not show up as a contributor because technically at that point in time, you still have no code in that master branch.
Your pull request was not opened and is sitting stagnant. Note that even if some did open your branches pull request, because of the reason above, you may not see yourself as a contributor still until they merged you.
Your branch was opened and closed without merging. Your code was not added to the master branch therefore you did not technically contribute.
The owners repository is private and he or she chooses not to share their private contributions. Because of this you are not able to share your contributions to their private repository either.
Commit rollback. Although I am not certain of this, perhaps if they rolled back past a commit that included your code, you may not show up. Once again, I am not certain of this.
存储库的所有者可能尚未合并您的分支,如果是这样,您可能不会以贡献者的身份出现,因为从技术上讲,在那个时间点,您在该主分支中仍然没有代码。
您的拉取请求未打开并且停滞不前。请注意,即使有些人确实打开了您的分支拉取请求,由于上述原因,在他们合并您之前,您可能仍然不会将自己视为贡献者。
您的分支在没有合并的情况下被打开和关闭。您的代码未添加到 master 分支,因此您在技术上没有做出贡献。
所有者存储库是私有的,他或她选择不共享他们的私有贡献。因此,您也无法将您的贡献分享到他们的私人存储库。
提交回滚。虽然我不确定这一点,但也许如果他们回滚了包含您的代码的提交,您可能不会出现。再一次,我不确定这一点。
Hope this answers your question.
希望这能回答你的问题。
回答by Vinayak Sakhare
Sometime if you do fork, commit or merge in your branch, it still doesn't show your name in contributors. It may be due to email which you set on command line is not mentioned in your git profile. Following steps work for me.
有时,如果您在分支中进行 fork、commit 或 merge,它仍然不会在贡献者中显示您的名字。这可能是由于您在命令行中设置的电子邮件未在您的 git 配置文件中提及。以下步骤对我有用。
- go to https://github.com/settings/emails
- Add your email to 'add Email address' option which is used on command line
- 去https://github.com/settings/emails
- 将您的电子邮件添加到命令行上使用的“添加电子邮件地址”选项
Now check the contributors tab on project. It will start showing your contributions.
现在检查项目上的贡献者选项卡。它将开始显示您的贡献。
回答by dpi
Github shows only the top 100 contributors for a project.
Github 仅显示项目的前 100 名贡献者。
If there are more than 100, the other contributors beyond these top 100 are never shown.
如果超过 100 名,则不会显示前 100 名之外的其他贡献者。
Even if you set a date range and there are less than 100 contributors displayed for the selected period, the list still only contains contributors who are among the all-time top 100.
即使您设置了日期范围并且所选时间段内显示的贡献者少于 100 名,该列表仍仅包含历史上前 100 名的贡献者。
回答by bravohex
Setting your email address for every repository on your computer
为计算机上的每个存储库设置电子邮件地址
git config --global user.email "[email protected]"
Then commit something and check contributors tab.
然后提交一些东西并检查贡献者选项卡。
Read more from Github
从Github阅读更多
回答by Chris
Check out Github's help on contributions: link
查看 Github 关于贡献的帮助:链接
In particular, if the repository you are contributing to is forked from another repository, or if they are merged into a non-default branch, they will not be counted on your profile.
特别是,如果您贡献的存储库是从另一个存储库分叉出来的,或者如果它们被合并到一个非默认分支中,它们将不会被计入您的配置文件中。
If they were commits to a pull request someone else opened, it is also possible that the maintainers squashed the commits, and then only the one who opened the pull request gets credit.
如果他们提交了其他人打开的拉取请求,维护者也有可能压缩了提交,然后只有打开拉取请求的人才能获得荣誉。