美文网首页
git配置多环境

git配置多环境

作者: 德罗德 | 来源:发表于2019-07-11 00:34 被阅读0次

配置git多环境
用户xxx: github上项目A
用户yyy: gitlab上项目B

//~/.ssh/config
host xxx.github.com
hostname github.com
user git
IdentityFile ~/.ssh/id_rsa_github

host yyy.gitlab.com
hostname gitlab.com
user git
IdentityFile ~/.ssh/id_rsa_gitlab
项目A地址 git@github.com:xxx/A.git
git clone  git@github.com:xxx/A.git
git remote remove origin
git remote add origin git@xxx.github.com:xxx/A.git
git pull
项目B地址 git@gitlab.com:xxx/B.git
git clone git@gitlab.com:yyy/B.git
git remote remove origin
git remote add origin git@yyy.gitlab.com:yyy/B.git
git pull

相关文章

网友评论

      本文标题:git配置多环境

      本文链接:https://www.haomeiwen.com/subject/dsoxkctx.html