- Gen 2 or multiple keys
ssh-keygen -t rsa -C key01@example
ssh-keygen -t rsa -C key02@example
- Setup ssh config
Host repo01
HostName <github.com, bitbucket.com...>
IdentityFile /path/to/key01
Host repo02
HostName <github.com, bitbucket.com...>
IdentityFile /path/to/key02
-
Setup repo
- New repo
GIT_SSH_COMMAND='ssh -i /path/to/key01' git clone git@github.com:SpoutEntertainment/repo01.git
GIT_SSH_COMMAND='ssh -i /path/to/key02' git clone git@github.com:SpoutEntertainment/repo02.git
- Existing repo
git remote set-url origin git@repo01:SpoutEntertainment/repo01.git
git remote set-url origin git@repo02:SpoutEntertainment/repo02.git