diff --git a/home/linux/Setting-Up-Git.md b/home/linux/Setting-Up-Git.md index 7909d4e..c13c373 100644 --- a/home/linux/Setting-Up-Git.md +++ b/home/linux/Setting-Up-Git.md @@ -2,7 +2,7 @@ title: Setting Up Git description: Steps to get up and running with Git published: true -date: 2024-07-04T22:14:00.453Z +date: 2024-07-04T22:20:13.392Z tags: editor: markdown dateCreated: 2024-06-30T20:44:58.238Z @@ -48,4 +48,14 @@ Host github.com or git server IdentityFile /path/to/privateKey ``` `stat -c %a keyfile` checks permissions of key if needed, must be 600 -`chmod 600 keyfile` \ No newline at end of file +`chmod 600 keyfile` + +Taken from [this superuser thread](https://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use): + +> Regarding contacting the same host with different keys: Here it is essential to understand that in `.ssh/config` +> `Host` is a *custom name* you can give to the host specified under `HostName`. +> The github.com part in the git URL git@github.com:torvalds/linux.git refers to this Host and thus has to match it exactly. +>If you have a second Github ssh key, you can create a section Host github2 in .ssh/config and then use the URL git@github2:torvalds/linux.g(see also superuser.com/a/1519694/96128). +–user905686 +Commented Apr 12, 2021 at 17:42 +