-
-
Save murarisumit/5a82f3c69e0a9d37239b to your computer and use it in GitHub Desktop.
Managing multiple SSH Keys for different GitHub Accounts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create separate SSH key for your personal account and your company. | |
Put these file in different location in your .ssh folder. | |
Upload them to your github account and finally create a **config file for your SSH** | |
Create a config file in ~/.ssh/config | |
vim config: | |
# PERSONAL ACCOUNT Github | |
Host github.com-COOL | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa_COOL | |
# COMPANY GitHub | |
Host github.com-COMPANY | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa_COMPANY | |
Setting up different config settings for each project: | |
CD to a project folder: | |
git config user.name "Your Name Here" | |
git config user.email [email protected] | |
Whereas you can have global Git Config: | |
git config --global user.name "Your Name Here" | |
git config --global user.email [email protected] | |
Example: | |
git clone [email protected]:COMPANY/ | |
git clone [email protected]:USERNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment