I'm really new to github and don't know very much. I changed my username to be a easier to find for people that know me or meet me. It tells me to update my local repositories to point to the new location. I don't know how to do this or how to find my old url and new url? Is there any way to find step by step what I need to do? I've found a few sources to learn github and git but those are lengthy. I plan to go through them to understand this more for the future but for now I want to change this so I can continue to work on my projects without worrying something messing up when I push to github. Thank you!
If your old username was XYZ, and your new one Jakeunderscore, then your old Github account would have been found at https://github.com/XYZ, and your new one, https://github.com/Jakeunderscore. So, for each repository that you have that has a remote pointing to Github, simply run the following command:
git remote set-url origin https://github.com/Jakeunderscore/repo_name.git
where repo_name represents the name of the current repository. Of course, this is assuming that you created a remote origin that pointed to your old repository link https://github.com/XYZ/repo_name.git
Update, addressing the comment:
If you created via the Github app, then it ought to have created an origin for you. To check, go to that folder, and type git remote -v. If you see origin (or 2 origins, its alright), then the command I posted ought to work. To check if it does actually work, try pulling from the repository with a git pull origin master, and you ought to get a message like Already up-to-date. Or, if you have unpushed commits in your repo, push to the repository with a git push origin master, and if it shows that everything is pushed without an error, you're good to go.
If, by chance, you don't have origin already created, create it with the command git remote add origin https://github.com/Jakeunderscore/repo_name.git.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With