1. 安装git
sudo apt-get install git
2. 生成ssh key(如果没有的话)
ssh-keygen -t rsa
3. 在github上添加 publickey
复制~/.ssh/id_rsa.pub的内容
右上角头像->settings->SSH and GPG kyes-> new SSH key->Add SSH key
4. 密钥不是默认的id_rsa
vim ~/.ssh/config, 添加以下
' # Default GitHub user
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/personalid'(密钥地址)