I am getting this error -

D:\Projects\wamp\www\REPO [master]> git pull origin master
Warning: Permanently added 'github.com,192.30.252.128' (RSA) vĩ đại the list of known hosts.
ERROR: Repository not found.
fatal: Could not read from remote repository.

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

The output of git remote -v

D:\Projects\wamp\www\REPO [master]> git remote -v
origin  [email protected]:username/repo.git (fetch)
origin  [email protected]:username/repo.git (push)

Final message of ssh -Tv [email protected] command -

Hi [My Username]! You've successfully authenticated, but GitHub does not provide shell access.

How can I solve it?

asked May 6, năm ngoái at 5:33

13

change your ssh url by an http url for your remote 'origin', use:

> git remote set-url origin https://github.com//.git

It will ask for your GitHub password on the git push.

answered Oct 14, năm nhâm thìn at 17:41

10

For má, I was getting this error because my ssh agent was not running somehow. Doing this worked:

eval `ssh-agent -s`
ssh-add path_to_your_key

answered Nov 16, 2021 at 15:56

2

I asked in the discussion:

does ssh -T [email protected] ouput the same username (in Hi [My Username]!) as in the one used for the ssh url of your repo ([email protected]:username/repo.git)?

Sorry It not showing same name

That means somehow the credentials have changed.

One solution would be vĩ đại at least copy %HOME%\.ssh\id_rsa.pub in the SSH keys section of the right GitHub account

The OP adds:

I am working on private repo. So In [email protected]:username/repo.git,

I replied:

If you were able vĩ đại clone/push vĩ đại that repo whose username is not your own GitHub tài khoản, that must be because you had your previous public ssh key added as a contributor vĩ đại that repo by the repo's owner.

What next is vĩ đại ask that same repo owner vĩ đại add your current public ssh key %HOME%\.ssh\id_rsa.pub vĩ đại the repo contributor list.
So kiểm tra with the owner that you (meaning your public ssh key) are declared as a contributor.

answered May 6, năm ngoái at 6:37

This error happened vĩ đại má too as the original repository creator had left the company, which meant their tài khoản was deleted from the github team.

git remote set-url origin https://github.com//.git

And then git pull origin develop or whatever git command you wanted vĩ đại execute should prompt you for a login and continue as normal.

answered Apr 21, 2017 at 12:37

1

Sometimes this happens vĩ đại má because of network problems. I don't understand the problem fully, but switching vĩ đại a different sub-network or using VPN solves it

answered Jun 22, năm ngoái at 15:06

6

This error can be because of no SSH key on the your local machine. Check the SSH key locally:

$ mèo ~/.ssh/id_rsa.pub

If above command bởi not give any output use below command vĩ đại create ssh key(Linux/Mac):

$ ssh-keygen 

Now again lập cập cat ~/.ssh/id_rsa.pub This is your SSH key. Copy and add this key vĩ đại your SSH keys in on git. In gitlab/bitbucket go to

profile settings -> SSH Keys -> add Key

and add the key

answered Nov 13, 2017 at 4:09

ssh-add -D  # Delete all identities.
ssh-add ~/.ssh/your_key

Edit 1
Since I get sánh many votes, I discovered some issue with this approach and that is that it will remove all your identities sánh you might have the same issue when you try vĩ đại read from other repositories and you will need vĩ đại to this step again for each project...but it might also not be the case for your project

answered Jul 16, 2020 at 10:56

Try:

git config --global credential.helper cache

This command prevents git vĩ đại ask username and password, not forever but with a mặc định limit vĩ đại 15 minutes.

git config --global credential.helper 'cache --timeout=3600'

This moves the mặc định limit vĩ đại 1 hour.

answered Apr 10, 2020 at 12:29

For má none of the solutions here solved it. Frustrated, I restarted my Macbook's iTerm terminal, and voila! My github authorization started working again.

Weird, but maybe iTerm has its own way of handling SSH authorizations or that my terminal session wasn't authorized somehow.

answered Sep 29, 2020 at 9:58

Easy solution for me:

  1. The public SSH Key has vĩ đại be saved on https://github.com/settings/keys

  2. The gmail address inside "~/.ssh/id_rsa.pub" (At the kết thúc of the file) has vĩ đại be entered on Github (https://github.com/settings/emails). (This was my problem)

After I saved the gmail address on GitHub, the problem solved itself.

answered Oct 10, 2022 at 21:49

I got the very same errors too. In My case upgrading from Windows 7 vĩ đại 8 messed up my settings. What helped was vĩ đại regenerate the private and public SSH keys using PuTTYGen, and change the SSH tool in tortoisegit from SSH vĩ đại Plink.

I have shared the step by step steps also at http://techblog.saurabhkumar.com/2015/09/using-tortoisegit-on-windows-with.html

answered Sep 11, năm ngoái at 2:59

Maybe, as in my silly situation, you may somehow created the ssh key by directly typing

ssh-keygen

And sánh it is created with the local system user credentials sánh they don't match, use full command lượt thích this and recreate

ssh-keygen -t rsa -b 4096 -C "[email protected]"

answered Mar 10, 2020 at 0:47

I needed vĩ đại have rw for user only permissions on config. This fixed it.

chmod 600 ~/.ssh/config

answered Sep 8, 2023 at 7:41

1

I had this issue and tried many things but still din't work. Eventually I decided vĩ đại generate another SSH KEY and boom - it worked. Follow this article by github vĩ đại guide you on how vĩ đại generate your SSH KEY.

Lastly don't forget vĩ đại add it vĩ đại your github settings. Click here for a guide on how vĩ đại add your SSH KEY vĩ đại your github tài khoản.

answered Jun trăng tròn, 2017 at 13:00

In my case updating GIT helps - I had version 2.23 and with installing version 2.26.2.windows.1 problem disapears.

So if you are sure your SSH key is valid then (see @VonC answer):

  1. update GIT
  2. update composer
  3. run composer clearcache

And it should be ok.

answered Apr 26, 2020 at 13:30

This issue could be related with missing SSH key at Github or any other git server.

In my case I had copied code vĩ đại another computer and tried vĩ đại git pull. It failed.

So I had vĩ đại generate a new SSH key on that machine and update profile on git server with additional SSH key.

answered Jun 18, 2020 at 19:07

Strangely I had this occur with a single repository out of > trăng tròn repositories on my Apple MacBook phiên bản Pro.

The solution was vĩ đại upgrade git via homebrew, and everything strangely worked after it finished:

brew install git

Hope this helps someone!

answered Jul 8, 2020 at 1:42

Its not necessary vĩ đại apply above solutions, I simply changed my mạng internet, it was working fine with my trang chủ mạng internet but after 3 vĩ đại 4 hours my friend suggest má vĩ đại connect with different mạng internet then I did data package and connect my máy vi tính with it, now it is working fine.

answered Dec 2, 2020 at 14:18

I had the same problem. I tried a couple of solutions mentioned above, it did not work for má. I even restarted my machine and also reconnected my WLAN. But all in vain. Then on the remote repo, I manually made a small change in the readme tệp tin of the repo. To pull that change on the local copy of my repo in my machine, I did the usual git pull and then the git push origin. This actually worked.

answered Oct 19, 2021 at 20:21

For má somehow sudo rebooting the fluffing EC2 instance after a fresh ssh-keygen and rm ~/.ssh/known_hosts fixed it! Still not sure how it works but it worked on 4 different EC2 servers with uptime over 700 days. I think it is related vĩ đại some breaking updates on some processes during the 700 days!! Still not sure what fixed it but for damn its fixed!

answered Dec 5, 2022 at 18:10

I faced the same issue because I have a lot of Git accounts, you can resolve this issue by instructions below:

For macOS

eval `ssh-agent -s`
ssh-add --apple-use-keychain ~/.ssh/your_key.pub

For Linux

eval `ssh-agent -s`
ssh-add ~/.ssh/your_key.pub

answered Nov 29, 2023 at 7:42

I was getting this error when I tried vĩ đại clone from my organization repository (my server ssh key was added vĩ đại my github tài khoản and I could clone from my personal repos, but could not clone from organization).

I mix up the server with Laravel Forge. During mix up, Laravel Forge creates Laravel Forge Application in Applications on GitHub (in the Authorized OAuth Apps tab). But this ứng dụng does not get access vĩ đại your organizations by mặc định.

The solution vĩ đại this error was vĩ đại grant access for Laravel Forge Application vĩ đại my organization in GitHub using GitHub interface. Open you applications here https://github.com/settings/installations, the go vĩ đại "Authorized OAuth Apps" tab, then choose "Laravel Forge" ứng dụng, then press the "Grant" button for the needed organization (see pictures).

This was not obvios vĩ đại má at first, because I thought that the Forge ứng dụng has access vĩ đại all repos by mặc định, including organization repos.

Applications

Laravel Forge Authorized OAuth App Grant buttons

When I created new projects on GitHub.com, the mặc định option for connecting vĩ đại the repository was SSH Key.

I was copying the links that starts with [email protected]:... and tried vĩ đại clone the repo with this links.

I had vĩ đại change vĩ đại the HTTPS tab and copy the url that starts with https://github.com//... vĩ đại use the git clone command.

If one creates a new local git repository and then attempts vĩ đại push it vĩ đại GitHub, GitHub will not create a new repository automatically. One has vĩ đại create a new repository on GitHub manually before one could push into it. That is another reason one could get the error:

ERROR: Repository not found.
fatal: Could not read from remote repository.

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