Whenever I start a session on my PC and try to git fetch
my remote repository, I get this 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.
What I do each time, then, is execute the following commands:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa_github
ssh -i ~/.ssh/id_rsa_github -T git@github.com
Once I've executed the commands above, git fetch
finally works properly. However, I don't want to repeat the same steps over and over again every time I turn my PC on. How do I solve this issue? I've already tried putting those three commands inside ~/.bashrc
, but that doesn't work.
In case you're wondering, I already added an SSH key to my GitHub account pasting the contents of the public key ~/.ssh/id_rsa_github.pub
, but I still have that issue.