Git Clone - Repository not found

前端 未结 25 1096
心在旅途
心在旅途 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:47

    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:password@github.com/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.

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

    What solved my problem, since I was having a "redirect/sign_in URL" or "repository not found" error

    MacOS Users:

    1. Open spotlight (Command Space)
    2. Type keychain (Open keychain access.app)
    3. Search for repo domain (GitHub, GitLab, etc)
    4. Delete all keys related to this domain
    5. Try to clone again (with valid credentials)

    Windows users should try similar steps, but Keychain would be Microsoft's Credentials Manager instead or Windows Credentials depending on yours OS version. Make sure to clean both web and windows credentials if that's the case.

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

    Possibly you did login in another account, and that account doesn't have access rights to this repo, if you're using mac os, go to Keychain Access, search for gitlab.com and remove it and try to git clone again.

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

    You should check if you have any other github account marked as "default". When trying to clone a new repo, the client (in my case BitBucket) will try to get the credentials that you have set "as default". Just mark your new credentials "as default" and it will allow you to clone the repo, it worked for me.

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

    Another reason for this error, if you are on github, and trying to use deploy keys for multiple repos, you will find this does not work.

    In that case you need to create a machine user, however if you don't and you try to clone any repo besides the one with the deploy key, you will get this error.

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

    On github you can have the main repository and subfolders. Make sure that the URL that you are using is that of the main repository and not that of a folder. The former will succeed and the latter will produce the repository not found error. If you have a doubt you are in a subfolder, navigate up the repository chain till you find a page which actually specified the https URL and use that.

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