Why doesn't my SSH key work for connecting to github?

后端 未结 9 1230
-上瘾入骨i
-上瘾入骨i 2021-01-30 02:19

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).

9条回答
  •  感情败类
    2021-01-30 02:35

    I had a similar problem, github did not use my SSH key. I always had to enter my username and password.

    I've been looking at .git/config, under [remote "origin"] there was:

        url = http://github.com/path/to/repository
    

    or

        url = https://github.com/path/to/repository
    

    I changed the line into

        url = ssh://git@github.com/path/to/repository
    

    and then it worked.

提交回复
热议问题