创建新得ssh key
ssh-keygen -t rsa -C "excem@excemple" -f ~/.ssh/id_rsa.gitlab
编辑config
vim ~/.ssh/config
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa.gitee
# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa.github
# gitlab
Host gitlab.com
HostName gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa.gitlab
测试
ssh -T git@gitlab.com