git - merge 来自同一用户的提交在 GitHub 上出现两次

标签 git github

注意到我的名字在我的存储库中出现了两次,在 GitHub 更新中,您会看到我的 GitHub 个人资料,并且只有我在正在编辑自述文件的网站上提交。在另一个名字(仍然是我的名字)上,您可以从计算机上看到我的 git 更新。

我怎么能 merge 这两个,因为它们都是我的。这是一个示例。到目前为止,我的代码贡献在贡献页面上是看不到的。链接在这里, 我怎样才能解决这个问题。

enter image description here

最佳答案

这些提交未链接到您的 GitHub 用户。

来自官方 GitHub help article :

If your commits are not linked to any user, we will display the grey Octocat logo beside them.

To check the email address used for those commits and connect commits to your account, take the following steps:

  1. Navigate to the commit by clicking the commit message link.
  2. To read a message about why the commit is not linked, hover over the blue to the right of the username:

enter image description here

Unrecognized author (with email address): If you see this message with an email address, it means the address has not been added to your account settings. To link your commits, add the email address to your GitHub email settings.

Unrecognized author (no email address): If you see this message without an email address, it means you used a generic email address that can't be added to your email settings. You will need to set your commit email address in Git, then add the new address to your GitHub email settings to link your future commits. Old commits will not be linked.

Invalid email: This means the email address in your local Git configuration settings is either blank or not formatted as an email address. You will need to set your commit email address in Git, then add the new address to your GitHub email settings to link your future commits. Old commits will not be linked.

如果有评论,您可以尝试使用 git config --global user.email "your_email@gmail.com" 将您的提交与您的 GitHub 用户名相关联。 Git 和 GitHub 的电子邮件地址必须相同。另请注意,这仅适用于 future 提交。对于过去的提交,您可以根据需要重新提交:

git reset --soft HEAD
git config --global user.email "your_email@gmail.com"
git commit -c ORIG_HEAD

另外,请实际require your admins to approve Pull Requests ,(而不仅仅是建议公众不要在没有这样做的情况下推送到您的 master 分支)。让 Pull Requests 开放以供公众 merge ,您就是在向各种不当行为敞开大门。

关于git - merge 来自同一用户的提交在 GitHub 上出现两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48939323/

相关文章:

git - 为什么 Git 在一次 merge 上执行自动提交,而不是在另一次 merge 上执行自动提交?

GIT Pre-Commit Hook 更改文件但不添加提交

eclipse - Egit 和 GitHub 出现 "Auth Failed"错误

git - .git 中的 Objects 文件夹对于我的小项目来说非常大

regex - 从命令行使用 git 属性

ruby - 要点没有得到颜色编码

r - loadNamespace(name) : there is no package called ‘Rsenal’ 中的错误

ios - 修改 iOS Cordova/PhoneGap 应用程序上的用户代理字符串

git - 我应该什么时候使用 git add?

git - `git gc` 和 `git repack -ad; git prune` 之间有什么区别吗?