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, gists, and profile history stay attached to your account — they do not get deleted or orphaned. The change takes effect when ready, and GitHub automatically redirects traffic from your old username to your new one for about nine months, which gives collaborators and tools time to catch up.
The catch is that some things break right away and stay broken unless you fix them. Git clone URLs that use your old username stop working when ready. Any scripts, CI/CD pipelines, or documentation that hardcodes your old username will point to a dead link. Webhooks and deploy keys tied to the old URL may fail. The redirect helps browsers find your profile, but it does not help a shell script or a GitHub Actions workflow that was written to pull from the old address.
Key Takeaways
- You change your username in your account settings under "Change username", and the change is when ready — there is no waiting period or approval process.
- GitHub redirects your old username to your new one for nine months, so links in browser history and search results still work, but automated tools do not follow redirects.
- Any repository clone URL, webhook, or deploy script using your old username will break when ready and must be updated by hand.
- Collaborators who have already cloned your repositories can update their local remotes with a single git command instead of re-cloning.
- Organizations you own or manage do not change when you change your username, but the URL to access them does.
What breaks when ready when you change your username
Git clone URLs that use your old username stop working the moment you change it. If someone runs git clone https://github.com/oldusername/repo, they will get a 404 error. The same is true for SSH URLs like git@github.com:oldusername/repo.git. The nine-month redirect only works in a web browser, not in the command line or in scripts.
Any continuous integration or deployment pipeline that references your old username will fail on the next run. GitHub Actions workflows, Jenkins jobs, GitLab CI pipelines, or any other tool that pulls code from a hardcoded URL will break. The same applies to webhooks you have set up to trigger builds or notifications — if the webhook URL contains your old username, it will 404 and stop firing.
Documentation, README files, and comments that mention your old username as a link will point to a dead page after the nine-month redirect expires. Search engines will eventually update their indexes, but in the meantime, old links will work in browsers but not in automated systems.
How to change your username in GitHub settings
Log in to GitHub and go to your account settings by clicking your profile photo in the top right, then selecting Settings. On the left sidebar, click Account. Scroll down to the Change username section. Type your new username in the text field and click I understand, let's change my username.
GitHub will warn you that changing your username may break things. Read that warning — it is accurate. The change takes effect when ready. Your old username becomes available for someone else to claim after a short delay, usually within minutes.
Updating your local repositories and scripts after the change
If you have cloned repositories on your computer, you need to update the remote URL so git knows where to push and pull. Open a terminal in the repository folder and run git remote set-url origin https://github.com/newusername/repo.git, replacing newusername and repo with your actual new username and repository name. You can check the current remote with git remote -v first to see what it points to now.
If you use SSH instead of HTTPS, the command is the same but the URL format changes: git remote set-url origin git@github.com:newusername/repo.git. You only need to do this once per repository on each machine where you have cloned it.
For any scripts, CI/CD pipelines, or documentation that hardcodes your old username, search for the old name and replace it with the new one. In GitHub Actions workflows, check the uses field if you have published any custom actions under your username. In deploy scripts or Dockerfiles, update any git clone commands. In README files and comments, update any links to your profile or repositories.
What happens to organizations and teams when you change your username
Organizations you own or are a member of do not change when you change your personal username. The organization itself keeps its own separate username and URL. However, if you are the owner of an organization, the URL to access your organization's settings may shift slightly depending on how GitHub's routing works at that moment — but the organization's own username and repositories remain stable.
Teams within organizations are not affected by your personal username change. Your role and permissions stay the same. Collaborators will still see you listed under your new username in team rosters and commit history.
The nine-month redirect and when it expires
GitHub redirects traffic from your old username to your new one for approximately nine months. This means if someone visits github.com/oldusername in a web browser, they will be sent to github.com/newusername. Search engines will eventually crawl the redirect and update their indexes, so old links may still work in Google results for a while.
After nine months, the redirect expires and your old username becomes fully available for someone else to register. At that point, any old links will 404. This is why updating documentation, README files, and any public-facing references to your username is important sooner rather than later — do not rely on the redirect to last forever.
The redirect does not explore to Git operations or API calls. A script or tool that tries to clone from your old username will fail when ready, not after nine months.
Frequently Asked Questions
Do I lose my repositories or contribution history if I change my username?
No. Your repositories, gists, stars, followers, and all commit history stay attached to your account. The change is purely cosmetic from GitHub's perspective — it is just updating the name associated with your account. Your contributions will still show on your profile and in repository histories.
What if I have published a package or library under my old username?
If you have published to npm, PyPI, RubyGems, or another package registry under your old username, those packages do not automatically update. You will need to update the repository URL in the package metadata and re-publish or update the package listing. Check the registry's documentation for how to transfer ownership or update the source URL.
Can I change my username back to the old one later?
Yes, you can change your username as many times as you want. However, if someone else has claimed your old username in the meantime, you cannot use it again unless that person releases it. It is best to decide on a username you are comfortable with before making the change public.
Will my GitHub Pages site break if I change my username?
If your GitHub Pages site is hosted at oldusername.github.io, the domain will not automatically redirect to newusername.github.io. You will need to update the repository name from oldusername.github.io to newusername.github.io and update any DNS records or custom domain settings. The nine-month redirect applies to your profile, not to GitHub Pages domains.
Do I need to update my SSH keys or personal access tokens?
No. Your SSH keys and personal access tokens are tied to your account, not your username. They will continue to work after you change your username. However, if you have any scripts or configuration files that reference your old username in a URL, those will need to be updated.