Error: Repository not found. If you see this error when cloning a repository, it means that the repository does not exist, you do not have permission to access it, or your GitHub Enterprise Server instance is in private mode.
If you're unable to clone a repository, check that: You can connect using HTTPS. For more information, see "HTTPS cloning errors." You have permission to access the repository you want to clone.
As mentioned by others the error may occur if the url is wrong.
However, the error may also occur if the repo is a private repo and you do not have access or wrong credentials.
Instead of
git clone https://github.com/NAME/repo.git
try
git clone https://username:[email protected]/NAME/repo.git
You can also use
git clone https://[email protected]/NAME/repo.git
and git will prompt for the password (thanks to leanne for providing this hint in the comments).
On macOS it's possible that the cached credentials in the Keychain that git is retrieving are wrong. It can be an outdated password or that it used the wrong credentials.
Follow the instructions at:
https://help.github.com/articles/updating-credentials-from-the-osx-keychain/
$ GIT_CURL_VERBOSE=1 git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
Look for the header line "Authorization: Basic BASE64STRING" .
Take the base64 string and decode it to check what username:password was used.
$ echo <the key> | base64 --decode
Verify it's the right username password you expected to use.
Most probably, your URL is not valid.
If it is a http/https URL, you can quickly check, by hammering the URL into a browser. If that does not display anything at all, you know that the URL is invalid.
I assume you are speaking of a remote repository. The URLs should look somewhat like these:
https://github.com/user/repo2.git if you're using HTTPS
[email protected]:user/repo2.git if you're using SSH
If you are using two factor authorization (2FA) for your Github account then just use SSH option for cloning your repository:
I was also having same issue. I was trying to clone the repo which was private and my git installed in osx has keychain which was not allowing me to clone the repo...
I tried
git clone https://username:[email protected]/NAME/repo.git
but it didn't work as my password was containing the field @.
I just ran
git credential-osxkeychain erase
host=github.com
protocol=https
command and press enter and it worked perfectly fine. Actually you need to remove the keychain already stored in the osx.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With