Skip to main content

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

Changing your GitHub username

You can change the username for your account on 您的 GitHub Enterprise Server 实例 if your instance uses built-in authentication.

Note: If you sign into 您的 GitHub Enterprise Server 实例 with LDAP credentials or single sign-on (SSO), only your local administrator can change your username. For more information about authentication methods for GitHub Enterprise Server, see "Authenticating users for 您的 GitHub Enterprise Server 实例."

About username changes

You can change your username to another username that is not currently in use.

After changing your username, your old username becomes available for anyone else to claim. Most references to your repositories under the old username automatically change to the new username. However, some links to your profile won't automatically redirect.

GitHub Enterprise Server cannot set up redirects for:

  • @mentions using your old username
  • Links to gists that include your old username

Repository references

After you change your username, GitHub Enterprise Server will automatically redirect references to your repositories.

  • Web links to your existing repositories will continue to work. This can take a few minutes to complete after you make the change.
  • Command line pushes from your local repository clones to the old remote tracking URLs will continue to work.

If the new owner of your old username creates a repository with the same name as your repository, that will override the redirect entry and your redirect will stop working. Because of this possibility, we recommend you update all existing remote repository URLs after changing your username. For more information, see "Managing remote repositories."

After changing your username, links to your previous profile page, such as https://[hostname]/previoususername, will return a 404 error. We recommend updating any links to your account on 您的 GitHub Enterprise Server 实例 from elsewhere.

Your Git commits

If your Git commits are associated with another email address you've added to your GitHub account, 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."

Changing your username

  1. 在任何页面的右上角,单击您的个人资料照片,然后单击 Settings(设置)

    用户� �中的 Settings 图� �

  2. 在左侧边� �中,单击 Account(帐户)帐户设置菜单选项

  3. In the "Change username" section, click Change username. Change Username button

Further reading