Git Clone - Repository not found

前端 未结 25 1095
心在旅途
心在旅途 2020-12-07 09:31
git clone 

gives the message fatal: repository \'url\' not found

I tried the options in the link, but it didn\'t work.

相关标签:
25条回答
  • 2020-12-07 09:41

    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
    
    0 讨论(0)
  • 2020-12-07 09:42

    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:

    1. Open Control Panel from the Start menu.
    2. Select User Accounts.
    3. Select "Manage your credentials" in the left hand menu.
    4. Delete any credentials related to Git or GitHub.
    0 讨论(0)
  • 2020-12-07 09:43

    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

    0 讨论(0)
  • 2020-12-07 09:43

    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.

    0 讨论(0)
  • 2020-12-07 09:45

    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.

    To update the credentials stored in OS X Keychain

    Follow the instructions at:

    https://help.github.com/articles/updating-credentials-from-the-osx-keychain/

    If you want to verify this is the problem you can run clone with tracing.

    $ 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.

    0 讨论(0)
  • 2020-12-07 09:45

    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.

    0 讨论(0)
提交回复
热议问题