同时使用github/gitlab


配置 Git 用户名、邮箱

1
2
git config --global user.name 'dalufanjiadan' && git config --global user.email 'dalufanjiadan@qq.com'
git config --local user.name 'gech' && git config --local user.email 'gech@yoozoo.com'

生成 ssh key

1
2
ssh-keygen -t rsa -f ~/.ssh/id_rsa.gitlab -C "gech@yoozoo.com"
ssh-keygen -t rsa -C "dalufanjiadan@qq.com"

配置 ~/.ssh/config 文件

1
2
3
Host gitlab.uuzu.com
IdentityFile C:\Users\gech\.ssh\id_rsa.gitlab
User gech

上传public key 到 Github/Gitlab


验证

1
2
ssh -T gitlab.uuzu.com
ssh -T git@github.com

  git
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×