话不多说,直入主题,本篇记录一下怎么在github上面添加电脑中的ssh key
官网教程: Checking for existing SSH keys - GitHub Docs
由于github一方面打开速度慢,有时候甚至打不开,本文单独记录一下:
-
Open Git Bash.
-
Enter
ls -al ~/.ssh
to see if existing SSH keys are present.
命令:
(1)cd ~/.ssh
(2)ls
(3)cat id_rsa.pub
复制id_rsa.pub的内容,到github --> settings -->SSH and GPG keys -
如果本地没有生成过ssh key,下面是生成方法:
命令:ssh-keygen -t ed25519 -C "your_email@example.com"
Generating a new SSH key and adding it to the ssh-agent - GitHub Docs