1. Personal information, create + configure ssh if not
git config -l # 查看个人信息
git config --global user.name “xxx” # 设置个人姓名 全局设置
git config --global user.email “xxx” # 设置个人邮件
Configure ssh
In order to distinguish it from the private key public key generated on github, we use -f to specify the file name
ssh-keygen -t rsa -C '[email protected]' -f ~/.ssh/gitee_id_rsa
Find the .ssh folder (hidden file) in the user's home directory to
create a new config file and add the following content
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee_id_rsa
# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
3. Test separately
ssh -T [email protected]
ssh -T [email protected]