Data report"State of code review 2024" is now liveRead the full report

Resolving git clone repo not found

Greg Foster
Greg Foster
Graphite software engineer


Note

This guide explains this concept in vanilla Git. For Graphite documentation, see our CLI docs.


This guide will provide a detailed approach to troubleshooting and fixing the "repository not found" error.

  1. Incorrect URL: The most common reason for this error is an incorrect repository URL. This can happen due to a typo, an outdated URL, or confusion between similar repository names.

  2. Access rights: If you don't have the correct access rights to a repository, Git will return a "repository not found" error instead of an "access denied" message, as it does not disclose the existence of private repositories without proper authentication.

  3. Deleted or moved repository: If the repository has been deleted, renamed, or moved to another location without updating dependent URLs, this error will occur.

  4. Network issues: Sometimes, network configurations or issues can prevent your machine from reaching the Git server, leading to this error.

  • Check the URL format: Ensure the URL is correctly formatted. For HTTPS, it should look like https://github.com/username/repository.git; for SSH, git@github.com:username/repository.git.
  • Check for typos: Verify each part of the URL, especially usernames and repository names, for typos.
  • Authentication: Make sure you are authenticated with the Git server. For GitHub and other platforms, this might mean checking your saved credentials or SSH keys.
  • Permissions: Ensure your account has the necessary permissions to access the repository, especially if it's private.
  • Repository existence: Confirm with the repository owner or your team that the repository still exists and has not been moved or renamed.
  • Public repositories: If the repository is public, ensure that it hasn't been made private or deleted, which could alter access permissions.
  • Internet connection: Test your internet connection to ensure it's stable and you have an intact network connection.
  • Firewall and VPN: Check if a firewall or VPN might be blocking your connection to the Git server. Sometimes, corporate firewalls block Git traffic, which may require adjusting settings or using a different network.
  • GitHub Desktop: If using GitHub Desktop, re-authenticate your account.
  • Command line: For command line operations, refresh your credentials. For HTTPS, you can use the credential helper with git config --global credential.helper cache.
  • SSH Keys: Ensure your SSH keys are correctly set up and added to your Git server. Use ssh -T git@github.com to test your SSH connection.

The "Git clone repository not found" error can stem from a variety of sources, ranging from simple typos in the repository URL to more complex issues like access rights or network restrictions. By methodically checking the repository URL, ensuring proper authentication and permissions, verifying the repository's status, and diagnosing potential network issues, you can effectively resolve this error.

If after following these steps you are still encountering this error, see the official Git documentation on Git clone, for more information.

Stay unblocked. Ship faster.
Experience the new developer workflow - create, review, and merge code continuously. Get started with one command.
Learn more

Give your PR workflow
an upgrade today

Stack easier | Ship smaller | Review quicker

Or install our CLI.
Product Screenshot 1
Product Screenshot 2