Git Clone - Repository not found

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

    In my case. repository is private I can't access it directly. On ly way to use Github Desktop app to fetch this repo.

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

    If you are using two factor authorization (2FA) for your Github account then just use SSH option for cloning your repository:

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

    I'm a devops engineer and this happens with private repositories. Since I manage multiple Github organizations, I have a few different SSH keys. To overcome this ERROR: Repository not found. fatal: Could not read from remote repository. error, you can use

    export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o User=git -i ~/.ssh/ssh_key_for_repo"
    
    git clone git@github.com:user/repo.git
    
    0 讨论(0)
  • 2020-12-07 09:57

    For me

    git clone https://username@github.com/name/repo.git
    

    worked.

    I think this mainly happens because Private repo can't be accessed directly.

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

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


    You can also use

    git clone https://username@github.com/NAME/repo.git

    and git will prompt for the password (thanks to leanne for providing this hint in the comments).

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

    Authentication issue: I use TortoiseGit GUI tool, I need to tell tortoise the username and password so that it can access to work with Git/GitHub/Gitlab code base. To tell it, rt click inside any folder to get TortoiseGit menu. Here TortoseGit > Settings Window > Select Credentials in left nav tree Enter URL:Git url Helper: Select windows if your windows credentials are same as the ones for Git or 'manager' if they are different userName; Git User Name Save this settings ans try again. You will be prompted for password and then it worked.

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