Git error: “Please make sure you have the correct access rights and the repository exists”

后端 未结 27 915
面向向阳花
面向向阳花 2020-12-12 14:49

I am using TortoiseGit on Windows. When I am trying to Clone from the context menu of the standard Windows Explorer, I get this error:

Please make sur

相关标签:
27条回答
  • 2020-12-12 15:07

    If it was working before and suddenly stopped working:

    This issue can be caused because sometimes ssh-agent is not persistent across reboots. You should check if ssh-agent has your key added:

    ssh-add -l -E md5
    

    if you get the output like:

    The agent has no identities.
    

    it means ssh-agent has lost your key. In that case, you simply need to add the identity key again. Something like:

    ssh-add ~/.ssh/git_rsa
    

    The error should disappear now!

    0 讨论(0)
  • 2020-12-12 15:08

    For me it was because of no SSH key on the machine. Check the SSH key locally:

    $ cat ~/.ssh/id_rsa.pub
    

    This is your SSH key. Add it to your SSH keys in the repository.
    In gitlab go to

    profile settings -> SSH Keys

    and add the key

    0 讨论(0)
  • 2020-12-12 15:09

    For me i was having issue with company VPN, after disconnecting working fine.

    Check connection with github using command ssh -vvvT git@github.com

    0 讨论(0)
  • 2020-12-12 15:10

    Strangely I only received this error in 1 of my many repos.

    My issue was after installing the new GitHub Desktop for Windows where the previous old GitHub for Win kept keys in ~/.ssh/github_rsa and ~/.ssh/github_rsa.pub where as the new GitHub for Win expects it in ~/.ssh/id_rsa so the solution was just renaming the existing private and public keys:

    ~/.ssh/github_rsa -> ~/.ssh/id_rsa
    ~/.ssh/github_rsa.pub -> ~/.ssh/id_rsa.pub
    

    After which let me access the repo again without issue.

    0 讨论(0)
  • 2020-12-12 15:10

    For me it gave the same error of:

    Please make sure you have the correct access rights and the repository exists.

    A quick fix was to eliminate the ~/.ssh/config file

    mv config config_old && touch config
    
    eval "$(ssh-agent -s)"
    
    git clone your_repo
    
    
    
    As it turned out to be the config file that was corrupt and configured with two ids
    
    0 讨论(0)
  • 2020-12-12 15:11

    That problem might be having with your ssh-agent, your ssh key hasn't been added with ssh-agent.You have to apply following steps using your terminal:-

    1. $ eval "$(ssh-agent -s)"

      Agent pid 5867

    2. $ ssh-add

      Enter passphrase for /home/you/.ssh/id_rsa: [] Identity added: /home/you/.ssh/id_rsa (/home/you/.ssh/id_rsa)

    then it will work..cheers J.

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