Change Your Github Name
In 7 easy steps
People change their names for a variety of reasons, common among them are either taking a spouse’s last name or shedding a deadname. I recently considered taking on my spouse’s last name (Lazer) in the midst of a career transition but ultimately decided against filing any paperwork, so made some shifts in my social presence online. While most social media options allow for quick adjustments in your account settings, Github took a bit more patience and pecking through each individual repository. Hopefully this quick guide saves you some time if you are looking to change your name for any reason.
Step 1: Change your name on the Github website. You will be warned that this may cause disruptions, but that’s expected. We’ll fix them below.
Step 2: Identify the current origin of your repository (fetch and push locations) by navigating to the folder in your terminal.
git remote -v
Step 3: Remove the existing repository name.
git remote remove origin
Step 4: Set the new url based on the website link from the new repository, pulled directly from your Github.
git remote add origin <url>
Step 5: Add the name of the repository, this will ease future navigations in your terminal.
git remote add <name> <url>
Step 6: Push using the remote name.
git push --set-upstream <name>
Step 7: Verify the pathways to ensure that the origin is updated and tracking to your new Github name!
git remote -v
Unfortunately, you will beed to repeat this process for all repositories. It’s also a good moment to take stock of your Github contents and clean up if necessary.