git 设置互信 兼容github gitee
cd ~/.ssh
ssh-keygen -t rsa -f ~/.ssh/id_rsa.gitee -C "361340499@qq.com"
一路回车
ssh-keygen -t rsa -f ~/.ssh/id_rsa.github -C "361340499@qq.com"
cat id_rsa.github.pub
复制公钥
vi ~/.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
测试
ssh -T git@gitee.com
ssh -T git@github.com
ssh -T git@github.com
Hi haogeoyes! You’ve successfully authenticated, but GitHub does not provide shell access.
ssh -T git@gitee.com
Hi haogeoyes! You’ve successfully authenticated, but GITEE.COM does not provide shell access.
git clone https://gitee.com/haogeoyes/allin-devops.git
git remote set-url origin https://github.com/Homebrew/brew.git
git push -u origin “master”