How to rename a GitHub repository in Git |Video upload date:  · Duration: PT4M32S  · Language: EN

Step by step guide to rename a GitHub repository and update local clones and remotes so pushes and pulls keep working.

Why rename a repo and why it matters

So you finally gave your repository a sensible name and escaped the dark times of vague project123. Nice move. GitHub will keep a redirect from the old URL for a while so things do not explode immediately. That does not mean everything will keep working forever. Continuous integration, webhooks, package registries, submodules and coworkers who memorize URLs like ancient runes can still fail. This quick how to walks through renaming on GitHub and updating your local git remotes and services so pipelines keep running and people stop yelling in the team chat.

Step 1 Rename the repository on GitHub

Go to the repository settings on GitHub and change the name field to the new name. GitHub will perform the rename and provide the new HTTPS and SSH clone URLs on the repo page. Copy the exact clone URL you plan to use. Do not assume the old URL will work forever even though GitHub is nice enough to redirect for a while.

Step 2 Update your local clone

Open a terminal in the local clone and run this to inspect remotes.

git remote -v

If the origin is still the old name update it with the clone URL you copied earlier.

git remote set-url origin git@github.com:yourorg/new-repo-name.git

Use the HTTPS URL if that is how you authenticate. Then verify the change and do a quick fetch to confirm permissions and connectivity.

git remote -v

git fetch origin

Troubleshooting tips

  • If git fetch fails check SSH keys or your credential helper.
  • If you still see the old URL double check you pasted the exact clone URL and that you updated the right remote name.
  • For clones that use submodules update each submodule or the superproject to point to the new name.

Step 3 Update other clones and services

Repeat the local remote update on other machines and CI runners. Then change any external references that should point to the new repo. Typical places to update include CI pipelines, deployment scripts, webhooks, badges in README files, package registry links and documentation. GitHub redirects help for a time but direct links keep things sharp and resilient.

Quick checklist before you celebrate

  • Updated origin with git remote set-url on every clone
  • Verified access with git fetch origin
  • Repointed CI and deployment configurations
  • Updated webhooks, integrations and package references
  • Fixed README badges and any hard coded URLs in docs

Final notes and cheering

Renaming a repository is a small act of cleanliness that can create temporary chaos if you do not update remotes and services. Follow these steps and you will avoid broken pipelines and frantic Slack messages. If something goes wrong roll back or contact your team and remember to breathe. Bonus reward is the smug satisfaction of a tidy repo name and slightly fewer confused contributors.

Tip When copying the clone URL paste the exact value into git remote set-url to avoid typos and wasted debugging time.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.