git could not read from remote repository, trying to push branch

Viewed 45

I'm trying to do git push origin my_branch but I'm seeing the below error:

Warning: Permanently added the RSA host key for IP address 'blah blah' to the list of known hosts.
ERROR: Repository not found.
fatal: Could not read from remote repository.

This is what I've tried already:

ls -al ~/.ssh
    
drwx------  5 krisp staff   160 Aug 24 12:19 .
drwxr-xr-x+ 67 krisp  staff  2144 Sep 13 08:07 ..
-rw-------   1 krisp  staff   419 Aug 24 12:15 id_ed25519
-rw-r--r--   1 krisp  staff   110 Aug 24 12:15 id_ed25519.pub
-rw-r--r--   1 krisp staff  3167 Sep 13 08:05 known_hosts

then

ssh -T git@github.com
Hi kri9ep! You've successfully authenticated, but GitHub does not provide shell access.

I saw this somewhere so I tried this:

ssh-add ~/.ssh/id_rsa
/Users/KrisP/.ssh/id_rsa: No such file or directory

and when I try this:

eval $(ssh-agent -s) 
Agent pid 5123

Someone mentioned to change the url in the .gitconfig file but I don't have url, this is what my .gitconfig file looks like:

[user]
    email = my_email@etc.com
    name = Kristoph P
[credential]
    helper = osxkeychain
1 Answers

ERROR: Repository not found. You're connecting fine. The repository does not exist. Check that you have the right path to the repository.

Run git remote -v and look at the URL. For example.

$ git remote -v
origin  git@github.com:user/repo.git (fetch)
origin  git@github.com:user/repo.git (push)

Check git@github.com:user/repo.git is correct for your repository. If not, use git remote set-url <new-url> to change it.

Someone mentioned to change the url in the .gitconfig file but I don't have url, this is what my .gitconfig file looks like:

They meant the config file in your local repository. .git/config. You'll see something like this.

[remote "origin"]
        url = git@github.com:user/repo.git
        fetch = +refs/heads/*:refs/remotes/origin/*

You can edit that, but a mistake can leave your repository broken. It's probably best to leave that alone. Use git-remote to manipulate it.

Related