Assume you already can access your person github repositories using public key id_rsa.pub
- Create another ssh private / public key pair
# file name: ~/.ssh/id_rsa2 ssh-keygen
- upload public key to your company's github
- create a ssh config at .ssh/config
Host github.com HostName github.com User git IdentityFile ~/.ssh/id_rsa AddKeysToAgent yes ServerAliveInterval 60 ServerAliveCountMax 30 # Work GitHub account Host github-work HostName github.com User git IdentityFile ~/.ssh/id_rsa2 AddKeysToAgent yes ServerAliveInterval 60 ServerAliveCountMax 30
- clone work repository
git clone git@github-work:mycompany/jackt.git
- clone your person repository as normal because it will use the default ssh config
No comments:
Post a Comment