https://www.cnblogs.com/popfisher/p/5731232.html
1.如何生成ssh公钥
- 使用git brash 客户端按如下命令来生成 sshkey:
ssh-keygen -t rsa -C "xxxxx@xxxxx.com"
2.git服务器添加ssh密钥
- GitHub添加SSH key的方式如下图所示:
3.修改config文件
- 文件地址:C:\Users\Poplar.ssh\config
- config内容:
#gitlab company
Host gitlab.9ijx.com ##可以随意命名
HostName gitlab.9ijx.com
User sky
Port 22
IdentityFile ~/.ssh/id_rsa
#github
Host github.com ##可以随意命名
HostName github.com
User sky
Port 22
IdentityFile ~/.ssh/id_rsa_github
#gitee
Host gitee.com ##可以随意命名
HostName gitee.com
User sky
Port 22
IdentityFile ~/.ssh/id_rsa_gitee
4.clone远端仓库源码
- 拷贝git服务器上项目ssh地址
- git brash客户端执行命令:
git clone git@gitee.com/AAAAAAAA.git