Problems using `go get`

macOS 10.12.5 Sierra
Golang 1.8.3

Hello, my system has suddenly developed a problem whereby I do not appear t be able to use the go get command. A typical session goes like this…

 ~/C/g/s/github.com  go get github.com/mtojek/oi
# cd .; git clone https://github.com/mtojek/oi /Users/carlca/Code/go/src/github.com/mtojek/oi
Cloning into '/Users/carlca/Code/go/src/github.com/mtojek/oi'...
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
package github.com/mtojek/oi: exit status 128

I have tried to repair my git credentials using this page https://help.github.com/articles/caching-your-github-password-in-git/ but it doesn’t seem to have made any difference.

Can anyone help?

Thanks,
Carl

Git is using ssh despite apparently being told to use https. That then fails because you don’t have the correct/appropriate/whatever ssh keys available.

You might have a config that says to use ssh instead of https for GitHub - look for insteadOf in the Git config, or google that for more info.

1 Like

Check that your SSH credentials are correctly loaded by the macOS authentication agent, using the terminal command ssh-add -l.

If not, add your credentials. See ssh-add -? and man ssh-add for options.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.