git clone
gives the message fatal: repository \'url\' not found
I tried the options in the link, but it didn\'t work.
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
git@github.com:user/repo2.git if you're using SSH
I had the same problem (Repository not found
) due to the fact that initially I logged in with an incorrect GitHub account. To fix it:
If you are on Windows, the repository is private, and different or not longer correct credentials were saved once, you won't have access to the repo. You will get the not found error without hinting in the failed-credential-direction. In order to reset the credentials on Windows, open Control Panel (Win+r control), select User Accounts and Credentials Manager. Locate the git account in Windows credentials (not Web credentials!) and erase this entry.
After that, cloning will pop up a login dialogue and you will be able to set these again.
Tested this with git-bash as shell in VSCode
For me the problems occurs because I have my old username/password settings saved for gitlab, so that I need to remove those credentials. I run the following command on my mac:
sudo su
git config --system --unset credential.helper
and do the clone again, enter the username and password. And everything is fine.
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.
This is happening because of my old session state of other user remain: Below is quick solution for Windows users,
Open Control Panel from the Start menu Select User Accounts Select "Manage your credentials" in the left hand menu Delete any credentials related to Git or GitHub
Once I did this, it started working for me.