Note: I\'m not a newb, and I\'ve done this a gazillion times, but for some reason today it decided not to work.
I keep getting the Permission denied (publickey).>
The GitHub ssh setup mentions testing your GitHub connection with:
$ ssh -T git@github.com
That follow the ssh uri syntax (also illustrated in "this answer").
But you did:
ssh github.com
(without any user). In that case, ssh reverts to the SCP syntax, which relies on a ~/.ssh/config
file, with a section "github.com
", to list:
~/.ssh/id_rsa.pub
)To change it to a regular SSH URL, don't edit directly your .git/config file, as shown below.
Use the command git remote set-url:
git remote set-url origin git@github.com:username/repo.git