Created
January 7, 2022 15:17
-
-
Save antonga23/c0fdfbdb934e4287c839ce1fc9e1bcad to your computer and use it in GitHub Desktop.
Revisions
-
antonga23 created this gist
Jan 7, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ 1. Generate keys for github accounts eg. ssh-keygen -t ed25519 -C "[email protected]" ssh-keygen -t ed25519 -C "[email protected]" 2. Start ssh-agent in background and add keys eval "$(ssh-agent -s)" ssh-add ~/.ssh/path_to_key1 ssh-add ~/.ssh/path_to_key2 3. Add ssh key to github, by pasting the *public* key to the browser 4. Modify ssh config file: .ssh/config Host github.com User git Hostname github.com PreferredAuthentications publickey IdentityFile ~/.ssh/INSERT_PRIVATE_KEY1 Host github-INSERT_NAME.com User git Hostname github.com PreferredAuthentications publickey IdentitiesOnly yes IdentityFile ~/.ssh/INSERT_PRIVATE_KEY2 git clone [email protected]:username/repo.git git clone git@github-INSERT_NAME.com:username/repo.git