Yes, you can change your GitHub username at any time
GitHub lets you change your username through your account settings. The process takes about two minutes and does not delete your account or repositories. Your old username becomes available for someone else to claim after a short grace period, but GitHub will redirect traffic from your old profile URL to your new one for a limited time.
The main thing to know before you change: any links you have shared — in documentation, on your website, in emails — will stop working after the redirect expires. If your username appears in scripts, deployment configurations, or package manager references, those will break when ready and need updating by hand.
Key Takeaways
- You change your username in Settings > Account, type the new name, and confirm — no verification email required.
- GitHub redirects your old profile URL to the new one for 20 days, but links in code, documentation, and external sites will not follow that redirect.
- Your repositories, commits, and contribution history stay attached to your account and move with you.
- If you use your GitHub username in SSH keys, deployment scripts, or package references, you must update those manually after the change.
- The old username becomes available for others to claim once the redirect period ends.
Where to find the username change setting
Log into GitHub and go to your profile picture in the top right corner. Click it and select Settings. On the left sidebar, click Account. You will see a field labeled Username with your current name in it. Click the pencil icon next to it or directly in the field to edit.
Type your new username. GitHub will tell you right away if it is already taken or if it contains characters that are not allowed. Usernames can contain letters, numbers, and hyphens, but cannot start or end with a hyphen. Once you type a valid name, click Change username and confirm in the dialog that appears.
What happens to your repositories and history
Your repositories, commits, pull requests, issues, and all contribution history stay with your account. They do not get deleted or separated from you. The URLs of your repositories will change — for example, github.com/oldname/myproject becomes github.com/newname/myproject — but GitHub redirects the old URLs to the new ones for 20 days.
After those 20 days, the old repository URLs will not redirect anymore. If someone tries to visit or clone from the old URL, they will get a "not found" error. Your contribution graph, stars, and followers all move with you to the new username.
What breaks and what you need to fix
The redirect only works for web browsers visiting your profile or repository pages. It does not work for git commands, API calls, or links embedded in code. If you have cloned a repository using the old username, the remote URL in your local copy will still point to the old address and will fail after the redirect expires.
To fix a cloned repository, open your terminal in that folder and run git remote set-url origin https://github.com/newname/reponame.git, replacing newname and reponame with your new username and the repository name. If you use SSH instead of HTTPS, the command is git remote set-url origin git@github.com:newname/reponame.git.
You also need to update your username anywhere it appears in code or configuration: deployment scripts, CI/CD pipelines, Docker files, package manager references, API endpoints, and documentation. Search your repositories for your old username to find these references.
SSH keys and authentication
Your SSH keys themselves do not break when you change your username. SSH authentication uses your account, not your username. However, if you have hardcoded your old username into any scripts or configuration files that construct SSH URLs, those will fail. Update any references to git@github.com:oldname/ to use your new username instead.
If you use GitHub's web interface to clone repositories, GitHub will automatically use your new username in the clone URL. The problem only happens if you manually typed or stored the old username somewhere.
Sharing links and external references
Any link you have shared to your profile, a specific repository, or a file in a repository will work for 20 days after the change, then stop working. If you have a link in your resume, website, or social media profile, update it to use your new username. The same goes for links in README files, documentation sites, or anywhere else outside of GitHub.
If you maintain a package in npm, PyPI, RubyGems, or another package manager, check whether the package metadata contains your GitHub username or profile link. Some package managers pull this from your GitHub account automatically, while others store it as static text that you need to update manually.
If you change your mind or made a mistake
You can change your username again at any time. There is no limit on how many times you can do this. If you change your username and then want to go back to the old one, you can do that — but only if no one else has claimed it in the meantime. Once the 20-day redirect period ends, the old username becomes available for anyone to register.
If someone else has already taken your old username, you cannot use it again unless they change theirs or delete their account. In that case, you would need to pick a different name.
Frequently Asked Questions
Will my commits show my new username or my old one?
Your commits will still show the name and email address that was set in your git configuration when you made them. Changing your GitHub username does not change the author name on past commits. If you want your profile to show the new username, you can update your git config going forward, but old commits will keep their original author information.
What happens to my GitHub Pages site if I change my username?
If you have a GitHub Pages site at oldname.github.io, it will stop working after the 20-day redirect period ends. You need to rename the repository to newname.github.io and update any DNS records or custom domain settings you have configured. GitHub's documentation on renaming repositories walks through the steps.
Do my followers and stars move with me?
Yes. Your followers, the repositories you have starred, and all your activity history stay attached to your account. People who were following you will still be following your account under the new username.
Can I reserve my old username so no one else can use it?
No. Once the 20-day redirect period ends, your old username becomes available for anyone to claim. GitHub does not have a way to lock or reserve a username you are no longer using. If you want to keep it, you would need to create a separate account with that username.
Will my API tokens or personal access tokens stop working?
No. Your authentication tokens are tied to your account, not your username. They will continue to work after you change your username. However, if you have stored your username in any scripts that use the API, you will need to update those references.