What will happen if I change github username? #154117
Hi everyone,I wanna change github username. But I have doubt because all repository remote URLs are based on github username. If I change my username then what will happen? If anyone have experience, please let me know. |
Replies: 2 comments 4 replies
|
GitHub automatically redirects links from your old username to the new one. |
|
Hi @smart-developer-p, This is what the docs say about changing your username:
So you don't have to worry about references to your repos with a new username. |
GitHub automatically redirects links from your old username to the new one.
But the url pointing to your profile will return status 404 so if you have any references to that username, you'd have to change them.
But if someone claims your old username and creates repository with the same name, the redirect would not work.
You can apply this command to your local repositories to change the remote url:
git remote set-url origin https://github.com/newusername/repository.git