1. ssh-keygen -t rsa -C "gitlab 邮箱" -f ~/.ssh/gitlab_id-rsa
2. cat gitlab_id-rs.pub 粘贴到 setting
3. ssh -T git@192.168.1.110 其中 192.168.1.110 为公司内网地址
1. ssh-keygen -t rsa -C "github 邮箱" -f ~/.ssh/github_id-rsa
2. cat github_id-rs.pub 粘贴到 setting
3. ssh -T git@github.com
touch ~/.ssh/config
config 内容如下:Host github
Port 22
User ***
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github_id-rsa
Host gitlab
Port ***
User ***
HostName 192.168.1.110
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab_id-rsa
gitlab 常常应用:git config --global user.name="gitlab user name"
git config --global user.email="gitlab email name"
github 偶然应用:cd github project
git config --local user.name="github user name"
git config --local user.email="github email name"