Coding⏱️ 2 min read📅 2026-05-31

How to Fix: Error with renamed repo in GitHub: "remote: This repository moved. Please use the new location"

Error with renamed repo in GitHub: "remote: This repository moved. Please use the new location"

Quick Answer: Try updating your local Git repository by running `git remote update` or `git fetch --all` to retrieve the new URL.

The error message 'remote: This repository moved. Please use the new location' occurs when you push updates from your local instance to remote master on GitHub. This issue arises due to a change in the repository's URL, which is not reflected in your local clone.

⚠️ Common Causes

  • Renaming the repository or its namespace on GitHub.

✅ Best Solutions to Fix It

Method 1: Update Remote Repository URL

  1. Step 1: Run the command `git remote -v` to check the current repository URL.

Method 2: Fetch New Repository URL

  1. Step 1: Run the command `git fetch origin --all` to fetch the new repository URL from GitHub.

🎯 Final Words

To avoid this issue in the future, make sure to update your local clone's repository URL whenever you rename or move your repository on GitHub. By following these steps, you should be able to resolve the 'remote: This repository moved' error and successfully push updates to your remote master.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions