Skip to main content

此版本的 GitHub Enterprise 已停止服务 2022-10-12. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

Why are my commits linked to the wrong user?

GitHub Enterprise Server uses the email address in the commit header to link the commit to a GitHub user. If your commits are being linked to another user, or not linked to a user at all, you may need to change your local Git configuration settings, add an email address to your account email settings, or do both.

Note: If your commits are linked to another user, that does not mean the user can access your repository. A user can only access a repository you own if you add them as a collaborator or add them to a team that has access to the repository.

Commits are linked to another user

If your commits are linked to another user, that means the email address in your local Git configuration settings is connected to that user's account on GitHub Enterprise Server. In this case, you can change the email in your local Git configuration settings and add the new email address to your account on your GitHub Enterprise Server instance account to link future commits to your account.

  1. To change the email address in your local Git configuration, follow the steps in "Setting your commit email address". If you work on multiple machines, you will need to change this setting on each one.
  2. Add the email address from step 2 to your account settings by following the steps in "Adding an email address to your GitHub account".

Commits you make from this point forward will be linked to your account.

Commits are not linked to any user

If your commits are not linked to any user, the commit author's name will not be rendered as a link to a user profile.

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. 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. Commit hover message

If your local Git configuration contained a generic email address, or an email address that was already attached to another user's account, then your previous commits will not be linked to your account. While Git does allow you to change the email address used for previous commits, we strongly discourage this, especially in a shared repository.

Further reading