Created
April 22, 2022 22:50
-
-
Save GitAlison/335852905fda2511a27aa53ba9c76583 to your computer and use it in GitHub Desktop.
This file contains 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 keys | |
cd .ssh/ | |
# Generate SSH key for each GitHub account | |
ssh-keygen -t rsa -C "[email protected]" | |
ssh-keygen -t rsa -C "[email protected]" | |
~/.ssh/id_rsa_personal | |
~/.ssh/id_rsa_work | |
$ ssh-add ~/.ssh/id_rsa_activehacker | |
$ ssh-add ~/.ssh/id_rsa_jexchan | |
# Configure users | |
$ git config user.name "work" | |
$ git config user.email "[email protected]" | |
$ git config user.name "personal" | |
$ git config user.email "[email protected]" | |
Add you reference keys | |
Create file in ~/.ssh/config | |
#Personal account | |
Host github.com-peronal | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/personal | |
#Work account | |
Host github.com-work | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/work | |
#Clone example | |
git clone [email protected]:personal/repository.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment