GIT同时配置github和gitee

生成ssh keys

### 一般生成
ssh-keygen -t rsa -C "[email protected]"
### 生成github
ssh-keygen -t rsa -f ~/.ssh/id_rsa.github -C "[email protected]"
### 生成gitee
ssh-keygen -t rsa -f ~/.ssh/id_rsa.gitee -C "[email protected]"

创建config

.ssh文件夹下创建并配置

# 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

github或者gitee中添加公钥

//公钥分别是.ssh目录下的id_rsa.gitee.pub和id_rsa.github.pub文件

你可能感兴趣的:(conclusion,github,git)