Yes, you can change your GitHub username, and your repositories move with you

GitHub lets you change your username at any time through your account settings. When you do, all your repositories, followers, and public activity history stay attached to your account — nothing gets deleted or lost. The change takes effect when ready, but there is a grace period where your old username redirects to your new one, so links and clones from other people's machines keep working for a while.

The main thing to know is that changing your username does break some things on your own machine if you have cloned repositories locally. If you have pushed code using the old username in your Git configuration, you will need to update the remote URL in each local repository folder. This is a one-time fix per project, not a permanent problem.

Key Takeaways

  • Your repositories, followers, stars, and contribution history all stay with your account when you change your username.
  • GitHub redirects your old username to your new one for about 20 minutes after the change, giving people time to update their links.
  • If you have cloned repositories on your computer, you need to update the remote URL in each one by running a single git command.
  • Changing your username does not affect any organizations you belong to or any teams that have access to your repositories.
  • You can change your username back to a previous one if you change your mind, as long as nobody else has claimed it in the meantime.

Where to change your username in GitHub settings

Log into GitHub and go to your account settings by clicking your profile photo in the top right corner, then select Settings. On the left sidebar, click Account. Near the top of that page, you will see a field labeled Username with your current name displayed. Click the pencil icon next to it or click directly in the field to edit it.

Type your new username and click Change username. GitHub will tell you right away if the name is already taken or if it contains characters that are not allowed. Usernames can contain letters, numbers, and hyphens, but they cannot start or end with a hyphen, and they cannot contain consecutive hyphens. Once you confirm the change, it happens when ready.

What breaks and what stays the same after you change your username

Your repositories, all your followers, your stars, your contribution graph, and your public activity feed all stay exactly as they are. Anyone who visits your old profile URL will be redirected to your new one automatically. The redirect lasts for about 20 minutes, which gives people time to update bookmarks and links. After that window closes, the old username becomes available for someone else to claim, but your account and everything in it is still under your new name.

What does break is the connection between your local Git repositories and GitHub if you cloned them using the old username in the remote URL. If you run git remote -v in a repository folder on your computer, you will see a URL that still points to the old username. This does not prevent you from pushing or pulling — GitHub knows who you are based on your SSH key or personal access token — but it is cleaner to update it so the URL matches your new username.

How to update your local repositories after changing your username

For each repository you have cloned on your computer, open a terminal or command prompt and navigate to that folder. Run git remote -v to see the current remote URL. If it contains your old username, you need to change it.

The command to update the remote URL is git remote set-url origin https://github.com/NEWUSERNAME/REPOSITORYNAME.git, replacing NEWUSERNAME with your new GitHub username and REPOSITORYNAME with the actual name of the repository. After you run that command, run git remote -v again to confirm the URL now shows your new username. You only need to do this once per repository.

If you use SSH instead of HTTPS, the command is the same but the URL format is different: git remote set-url origin git@github.com:NEWUSERNAME/REPOSITORYNAME.git. You can tell which one you are using by looking at the output of git remote -v — HTTPS URLs start with https:// and SSH URLs start with git@github.com:.

Organizations and teams are not affected by your username change

If you are a member of any GitHub organizations or teams, your membership stays the same. The organization's repositories and settings do not change. Your username change does not affect your access to any shared repositories or your role within any team. If you have administrative access to an organization, that access remains unchanged.

Other people in your organizations will see your new username in pull requests, comments, and commit history going forward, but the change does not require any action from them or from the organization owner.

Changing your username back or choosing a different one later

You can change your username as many times as you want, as long as the name you want is not already taken by someone else. If you change your username and then want to switch back to your old one, you can do that when ready — GitHub will let you reclaim it. However, if someone else has claimed your old username in the meantime, you cannot use it again unless they change theirs first.

There is no limit on how often you can change your username, and there is no waiting period between changes. Each change takes effect when ready and triggers a new redirect from the old username to the new one.

What happens to URLs and links that use your old username

Any URL that points to your old GitHub profile or a repository under your old username will redirect to the new one for about 20 minutes. This includes profile links like github.com/oldusername and repository links like github.com/oldusername/myproject. After the redirect window closes, those old URLs will return a 404 error and will not work anymore.

If you have shared links to your profile or repositories with other people, you should update them to use your new username. If you have a README or website that links to your GitHub profile, update those links as well. The redirect window is short enough that you should treat the old URLs as permanently broken after the change.

Frequently Asked Questions

Will my followers or stars disappear when I change my username?

No. Your followers, stars, and all your contribution history stay attached to your account. Everyone who followed you before the change will still be following you after, and all your starred repositories will still be starred. The change is purely cosmetic to your username — your account history and relationships do not change.

Do I need to update my SSH key or personal access token after changing my username?

No. Your SSH key and personal access tokens work the same way after you change your username because GitHub identifies you by the key itself, not by your username. You only need to update the remote URL in your local repositories if you want the URL to reflect your new username.

What if someone takes my old username after I change it?

After the 20-minute redirect window closes, your old username becomes available for anyone to claim. If someone else takes it, you cannot use it again unless they change theirs. You can always change your username to something else, but you cannot reclaim the old one if it has been taken by someone else.

Will changing my username affect my GitHub Pages site?

If you have a GitHub Pages site at oldusername.github.io, you will need to rename the repository to newusername.github.io for the site to work under your new username. The site itself will not automatically update when you change your username. You can do this by going to the repository settings and changing the repository name.

Can I change my username if I have open pull requests or issues?

Yes. Your open pull requests, issues, and comments will all stay attached to your account and will show your new username going forward. The change does not close or affect any open work. People reviewing your pull requests will see your new username, but the pull request itself remains unchanged.