GitHub is a code hosting platform for version control and collaboration. It’s a great place to share your code with others and work on projects together. Your GitHub username is the unique name that identifies you on GitHub. If you’re not happy with your current username, you can change it! Here’s how to do it.
Table of Content
Things You Should Know To Change GitHub Username
- You want to change your identifier on GitHub.
- You want to change the URL identifier of your profile and your repositories.
- You need to follow the steps carefully to be able to change your username on GitHub.
What Happens After Changing GitHub Username
Changing your GitHub username will affect all your files stored in the repository. This also will create a new path and directory referred to the new username.
1. Repository References
GitHub will automatically redirect references to your repositories after you change your username.
- Web links to your existing repositories will remain active. After you make the change, this may take a few minutes to complete.
- Command line pushes to the old remote tracking URLs from your local repository clones will continue to work.
If the new owner of your old username creates a repository with the same name as your repository, the redirect entry will be overwritten and your redirect will no longer work.
Because of this possibility, we recommend that after changing your username, you update all existing remote repository URLs. See “Managing Remote Repositories” for more information.
2. Links to your previous profile page
Links to your previous profile page, such as https://github.com/previoususername, will return a 404 error after you change your username. We recommend that you update any links to your GitHub.com account from other places, such as your LinkedIn or Twitter profiles.
3. Your Git Commits
Git commits associated with your noreply email address provided by GitHub will not be attributed to your new username and will not appear in your contributions graph. If you’ve added another email address to your GitHub account, including the ID-based GitHub-provided no-reply email address, your Git commits will still be attributed to you and appear in your contributions graph after you change your username. See “Setting your commit email address” for more information on how to do so.
4. Your Gists
The URLs to any public or secret gists will change after you change your username, and previous links to these will return a 404 error. We recommend that you update any links to these gists that you may have shared.
How to Change GitHub Username
If you have any projects that are using your old username as a remote, you’ll need to update the URL. With that said, let’s get started!
- Click your profile photo in the upper-right corner of any page, then “Settings.”
- Click the “Gear/Setting” Account in the left sidebar.
- Click Change username in the “Change username” section.
- Read the cautionary notes about changing your username. If you want to keep your current username, click “I understand, let’s change my username.”
- Create a new username.
- Click “Change my username” if the username you’ve chosen is available. If the username you’ve chosen is not available, you can try another or one of the suggestions.
Tips
Your GitHub username is how you’re identified on the platform. If you’re not happy with yours, no worries! Changing it is a pretty straightforward process. Just keep in mind that changing your username will also change the URL of your profile and all your repositories, so make sure to update any remotes that are using your old username accordingly.