Skip to content

Instantly share code, notes, and snippets.

@nnance
Forked from apoo/gist:2279196
Created August 21, 2014 03:56
Show Gist options
  • Save nnance/acf07a2e6a9c852c527b to your computer and use it in GitHub Desktop.
Save nnance/acf07a2e6a9c852c527b to your computer and use it in GitHub Desktop.
Create separate SSH key for your personal account and your company. Named them with different extensions 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/
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 your@email.com
Whereas you can have global Git Config:
git config --global user.name "Your Name Here"
git config --global user.email your@email.com
Example:
git clone git@github.com-COMPANY:COMPANY/
git cline git@github.com-COOL:USERNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment