Yes, you can change your GitHub username, and your repositories move with it
GitHub lets you change your username at any time through your account settings. When you do, all your repositories, stars, followers, and contribution history stay attached to your account — they do not get lost or reassigned. The change takes effect when ready, but there are a few things that break and need fixing afterward, mainly links in documentation and clone URLs that point to your old username.
The process itself takes less than a minute. The harder part is updating everything that references your old name: README files, CI/CD configuration, deployment scripts, and anywhere else you hardcoded your GitHub URL. If other people have cloned your repositories, their local copies will still point to the old username until they update their remote URLs.
Key Takeaways
- Changing your username is free and when ready, and your repositories, followers, and contribution history all stay with your account.
- GitHub automatically redirects traffic from your old username to your new one for about nine months, giving you time to update links.
- You must manually update any hardcoded URLs in README files, documentation, CI/CD workflows, and deployment configuration.
- Anyone who cloned your repositories before the change will need to run git remote set-url origin to point to your new username.
- Organization names cannot be changed the same way — you must create a new organization and transfer repositories manually.
Where to change your username in GitHub settings
Log into GitHub and go to Settings (the gear icon in the top right). Click Account in the left sidebar, then scroll down to the "Change username" section. Type your new username and click "Change username" to confirm. GitHub checks whether the name is available and whether it follows their naming rules — usernames can contain letters, numbers, and hyphens, but cannot start or end with a hyphen.
The change is live when ready. Your profile URL shifts from github.com/oldname to github.com/newname, and all your repositories are now at github.com/newname/repo-name instead of github.com/oldname/repo-name.
What GitHub redirects automatically and what you have to fix
GitHub redirects old URLs to new ones for about nine months. If someone visits github.com/oldname/my-project, they get sent to github.com/newname/my-project without seeing an error. This redirect covers web traffic but not Git operations — cloning, pushing, and pulling still work because GitHub's servers recognize both the old and new paths.
What does not redirect: any URL you wrote into a file. If your README says "Clone this repo from github.com/oldname/my-project", that link is now wrong. The same goes for CI/CD workflows (GitHub Actions, Jenkins, GitLab CI), deployment scripts, Docker configuration, package.json files that reference your repositories, and any documentation you published. Search your repositories for your old username and update those references manually.
Updating clone URLs in existing local repositories
If you cloned a repository before changing your username, your local copy still points to the old URL. The next time you try to push or pull, Git will follow the redirect and succeed, but it is cleaner to update the remote URL yourself.
Open your terminal, navigate to the repository folder, and run:
git remote set-url origin https://github.com/newname/repo-name.git
Replace newname with your new username and repo-name with the actual repository name. You can verify the change worked by running git remote -v, which shows the current remote URLs. If you use SSH instead of HTTPS, the URL format is git@github.com:newname/repo-name.git.
Updating URLs in README files and documentation
Search your repositories for your old username using GitHub's search feature or by running grep locally. Common places to update: clone instructions in README files, links to issues or pull requests, links to raw files (like badges or images hosted in your repo), and any documentation that shows how to install your project.
If you maintain a website or blog that links to your repositories, update those links too. The redirects will keep them working, but updating them prevents confusion and ensures you are not relying on a temporary feature.
Fixing CI/CD pipelines and deployment scripts
GitHub Actions workflows, Docker builds, and deployment scripts often reference your repository URL. Search your .github/workflows directory for your old username and update any hardcoded URLs. If you use a personal access token or deploy key to clone your own repositories, those still work after the username change — the token is tied to your account, not your username.
If you have webhooks set up (for example, triggering a build on push), GitHub updates the webhook URL automatically, so those continue working without changes on your end.
What happens to organization names and team repositories
Changing your personal username is straightforward, but organization names work differently. You cannot change an organization's name through settings the way you can with a personal account. Instead, you must create a new organization with the desired name, transfer all repositories to it, and then delete the old organization. This is more involved because you have to move repositories one at a time and update team memberships.
If you own repositories in an organization and want to move them to a personal account, you can transfer individual repositories through their settings. Go to the repository's Settings, scroll to the Danger Zone, and click "Transfer ownership". GitHub will ask you to confirm and will update all the URLs and references for you.
Frequently Asked Questions
Will my GitHub contributions and commit history disappear if I change my username?
No. Your contribution graph, commit history, and all your activity stay attached to your account. The commits themselves do not change — they still show your name and email as the author. Only the URL to view them changes.
Can someone else take my old username after I change it?
Yes. After you change your username, the old one becomes available for anyone to claim. If you want to reserve it, you can create a new account with that username or contact GitHub Support to ask them to hold it. Most people do not need to reserve old usernames unless they are concerned about impersonation.
Do I need to update my SSH keys or personal access tokens?
No. SSH keys and personal access tokens are tied to your account, not your username. They continue working exactly as before. You only need to update the repository URLs in your Git configuration and any files that reference your old GitHub URL.
What if I have a lot of repositories with hardcoded URLs?
You can use find and replace across all your repositories at once if they are stored in a single folder. In your terminal, navigate to the parent directory and run a command like find . -type f -name "*.md" -exec sed -i 's/oldname/newname/g' {} \; to replace your old username with your new one in all Markdown files. Test this on a backup copy first to make sure it works as expected.
Can I change my username back to what it was before?
Yes. You can change your username as many times as you want. However, if someone else claimed your old username in the meantime, you cannot take it back. GitHub does not reserve old usernames, so if you change from alice to alice-dev and then want to go back to alice, you can only do so if alice is still available.