How to Rename a Repository on GitHub: Step-by-Step Guide

Whether you’ve rebranded your project, refined its purpose, or simply want a clearer name, renaming a repository on GitHub is straightforward. But there are a few important steps to ensure your local and remote copies stay in sync.

In this guide, we’ll walk you through how to safely rename a GitHub repository—and update your local setup to reflect the changes.


🔐 Who Can Rename a Repository?

Only users with Admin access to a repository can rename it.

If you’re part of a GitHub organization, you must also have the appropriate permissions.


✅ Step-by-Step: Renaming a GitHub Repository

1. 🔧 Go to Your Repository Settings

  1. Log into GitHub.
  2. Navigate to the repository you want to rename.
  3. Click the Settings tab (top-right of the repo).
  4. In the Repository name section, update the name.
  5. Click Rename.

✅ GitHub will automatically create redirects from the old name to the new one—so old links won’t immediately break.


🧠 What Happens After Renaming?

  • The repository URL changes (e.g., github.com/your-username/old-namegithub.com/your-username/new-name).
  • Cloning or pushing using the old remote URL will still work (temporarily, thanks to GitHub’s redirects).
  • For safety, it’s best to update your local Git remote URL.

🔄 Step 2: Update Your Local Git Remote (Recommended)

Open your terminal and navigate to your local repository:

cd path/to/your-local-repo

Then update the remote URL:

git remote set-url origin https://github.com/your-username/new-repo-name.git

To verify it:

git remote -v

You should see the new URL listed for origin.


🧪 Optional: Test the Setup

Try pushing or pulling to make sure everything works:

git push
git pull

If you use GitHub Pages, CI/CD, or webhooks, check those integrations after renaming.


🧹 Bonus: Update README and Links

After renaming, be sure to:

  • Update your README.md to reflect the new name.
  • Fix any internal documentation or badge links.
  • Let collaborators or contributors know about the change.

📌 Summary

TaskRequired Action
Rename on GitHubGo to Settings → Change repository name
Update local repoUse git remote set-url
Verify remoteUse git remote -v
Check integrationsTest CI/CD, webhooks, GitHub Pages
Update documentationREADME, wikis, and links

🎯 Conclusion

Renaming a GitHub repository is a quick and simple task, but it’s important to update your local environment and notify collaborators. GitHub’s automatic redirects reduce disruption, but taking a few extra steps ensures your workflow stays smooth.

Sharing Is Caring:

Leave a Comment