Your Github login username could be changed to another username that is not in use. You might have to consider some unique usernames if the username you want is not available. You can use the different signs like hyphens, numbers, or alternative spellings to get a similar username that is still available.
Your old GitHub login username can be claimed by anyone after you have changed your username. Except for some links to your profile that wouldn't redirect automatically, most of the other references to your repositories that were under the old username are changed automatically to the new username.
Redirects cannot be set up for:
- @mentions that use your old username
- The links to gits that include your old username
Steps To Change Your Github Login Username
- First, click your profile photo, then click Settings.
- In the left sidebar, click Account.
- Under the "Change username" section, click on Change username.
- Make sure that you read the warnings about changing your username and then click I understand, let's change my username.
- Type a new username.
- Make sure that the username that you have chosen is available and then click Change my username.
Where To Make Changes
- Go to the GitHub account settings and change the username.
- If you are using GitHub Pages, you could just change the name of your “username.github.io” repository
- Other services that point to your “username.github.io” repository address should now be updated.
- You might want to sign in and reconnect your repositories when using Netlify.
- You can sign in to Travis CI and other integrations as it will update your username there.
- Make sure that your local files and repository links are updated and the changes to GitHub are pushed back.
- With your updated GitHub link redeploy any websites that you may have.
- You can then fix any links around the web to your profile, Gists, or your repositories.
Local File Updates
We have for you some suggestions for strings, which you can use to search and replace your username.
- github.com/username ( you get the references to your GitHub page in READMEs or in website copy)
- username.github.io ( you will get links to your GitHub Page)
- git@github.com:username ( you get Git config remote ssh URLs)
- travis-ci.com/username (Travis badges in READMEs)
- shields.io/github/.../username ( the shield badges would be in READMEs, types include stars, tags, contributors, and more)
You can use this command for each string after you identify where the above strings are located:
grep -rnw -e 'foobar'
It will search all files for strings matching the whole (w) pattern (e) recursively (r) provided and prefix results with the line numbers (n) so you can find them easily.