git配置多环境

配置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地址 [email protected]:xxx/A.git
git clone  [email protected]:xxx/A.git
git remote remove origin
git remote add origin [email protected]:xxx/A.git
git pull
项目B地址 [email protected]:xxx/B.git
git clone [email protected]:yyy/B.git
git remote remove origin
git remote add origin [email protected]:yyy/B.git
git pull

你可能感兴趣的:(git配置多环境)