Yes, you can change your GitHub username, and it takes about two minutes

GitHub lets you change your username whenever you want through your account settings. The change takes effect when ready, and GitHub automatically redirects anyone who visits your old profile URL to your new one. Your repositories, followers, and contribution history all move with you — nothing gets lost or broken.

The one thing to know upfront: if you have repositories cloned on your computer, the remote URL will still point to your old username. You'll need to update those URLs locally so Git knows where to push and pull from. This is a one-time fix for each repository on each machine.

Key Takeaways

  • You change your username in GitHub's account settings under "Change username", and the change is when ready.
  • GitHub redirects your old profile URL to your new one, so old links still work.
  • Any repositories you cloned before the change will have outdated remote URLs that you need to update locally.
  • Organizations, teams, and collaborators will see your new username when ready in their notifications and on your profile.
  • You cannot change your username to one that is already taken or that you used in the past 30 days.

How to change your username in GitHub settings

Log into GitHub and go to your account settings by clicking your profile picture in the top right corner, then select Settings. On the left sidebar, click Account. Scroll down to the "Change username" section — you'll see your current username in a text field.

Type your new username into the field. GitHub will tell you right away if the name is taken or unavailable. Once you see the green checkmark saying the name is available, click the I understand, let's change my username button. GitHub will ask you to confirm by typing your password. After you enter it, the change is done.

Your new username is live when ready. Anyone who tries to visit your old profile URL will be sent to your new one automatically, and all your repositories are now under the new name.

Updating your local repositories after a username change

If you have cloned repositories on your computer, Git still thinks they belong to your old username. When you try to push or pull, you might see an error or be prompted for credentials. The fix is to update the remote URL for each repository.

Open your terminal or command prompt and navigate to the repository folder. Run this command to see the current remote URL:

git remote -v

You'll see something like https://github.com/oldusername/repo-name.git. To update it to your new username, run:

git remote set-url origin https://github.com/newusername/repo-name.git

Replace newusername with your actual new username and repo-name with the repository name. Run git remote -v again to confirm the URL changed. Do this for every repository you have cloned locally.

What stays the same and what changes

Your repositories, all your code, commit history, and contribution graph stay exactly the same. Your followers and the people you follow are not affected. Any stars, forks, or issues you created remain under your account. Organizations you belong to will see your new username, but your membership and permissions do not change.

If you have SSH keys set up, they continue to work without any changes. If you use HTTPS and have saved credentials, you may need to re-enter your password once after the username change, depending on your operating system and how you store credentials.

Restrictions on changing your username

You cannot change your username to one that is already taken by another user. You also cannot change to a username you used in the past 30 days — GitHub prevents this to avoid confusion with old profile links and references. If you want to use a username you had before, you'll need to wait 30 days after you changed away from it.

GitHub usernames can contain letters, numbers, and hyphens, but cannot start or end with a hyphen. If you try to use a name that breaks these rules, GitHub will tell you it is invalid.

Handling old links and references to your old username

Because GitHub redirects your old profile URL to your new one, people who have bookmarked your profile or shared a link to it will still reach you. The same is true for links to your repositories — old URLs keep working.

However, if you have written your username in documentation, README files, or anywhere else outside GitHub, those references will not update automatically. If you want those places to show your new username, you'll need to edit them yourself. This is especially important if your username appears in code comments, installation instructions, or contact information.

Frequently Asked Questions

Will my repositories disappear or get deleted when I change my username?

No. Your repositories stay on your account with all their code, history, and issues intact. The only thing that changes is the URL — they move from github.com/oldusername/repo to github.com/newusername/repo. Old URLs redirect automatically.

Do I need to update my SSH key after changing my username?

No. SSH keys are tied to your account, not your username, so they continue to work without any changes. If you use HTTPS instead, you may be asked to enter your password once after the change.

What happens if I change my username and then want to change it back?

You can change back to your old username, but only after 30 days have passed since you changed away from it. GitHub enforces this waiting period to prevent confusion with old links and references.

Will my collaborators be notified when I change my username?

Your collaborators will see your new username the next time they visit your profile or a repository you work on together. GitHub does not send a notification about the change, so if you work closely with others, it is a good idea to let them know you changed it.

Do I need to update my GitHub Pages site URL if I change my username?

If your GitHub Pages site uses your username in the URL (like username.github.io), the URL will change to your new username automatically. Any old links to the site will redirect to the new URL, so you do not need to update anything manually.