Skip to main content

Changing your GitHub username

You can change the username for your account on GitHub.com.

Note: Members of an enterprise with managed users cannot change usernames. Your enterprise's IdP administrator controls your username for GitHub Enterprise Cloud. For more information, see "About Enterprise Managed Users."

About username changes

You can change your username to another username that is not currently in use. If the username you want is not available, consider other names or unique variations. Using a number, hyphen, or an alternative spelling might help you find a similar username that's still available.

If you hold a trademark for the username, you can find more information about making a trademark complaint on our Trademark Policy page.

If you do not hold a trademark for the name, you can choose another username or keep your current username. GitHub 支持 cannot release the unavailable username for you. For more information, see "Changing your username."

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 Cloud cannot set up redirects for:

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

If you're a member of an enterprise with managed users, you cannot make changes to your username. 有关详细信息,请参阅“GitHub 帐户的类型”。

Repository references

After you change your username, GitHub Enterprise Cloud 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://github.com/previoususername, will return a 404 error. We recommend updating any links to your account on GitHub.com from elsewhere, such as your LinkedIn or Twitter profile.

Your Git commits

Git commits that were associated with your GitHub Enterprise Cloud-provided noreply email address won't be attributed to your new username and won't appear in your contributions graph. If your Git commits are associated with another email address you've added to your GitHub account, including the ID-based GitHub Enterprise Cloud-provided noreply email address, 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."

Your gists

After changing your username, the URLs to any public or secret gists will also change and previous links to these will return a 404 error. We recommend updating the links to these gists anywhere you may have shared them.

Changing your username

  1. 在任何页面的右上角,单击个人资料照片,然后单击“设置”。

    用户栏中的 Settings 图标

  2. In the left sidebar, click Account.

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

  4. Read the warnings about changing your username. If you still want to change your username, click I understand, let's change my username. Change Username warning button

  5. Type a new username. New username field

  6. If the username you've chosen is available, click Change my username. If the username you've chosen is unavailable, you can try a different username or one of the suggestions you see. Change Username warning button

Further reading