docs: update home/linux/Setting-Up-Git

This commit is contained in:
Cheeks 2024-07-04 22:20:15 +00:00 committed by cheeks
parent ae149c6057
commit 862d9e8d63

View File

@ -2,7 +2,7 @@
title: Setting Up Git title: Setting Up Git
description: Steps to get up and running with Git description: Steps to get up and running with Git
published: true published: true
date: 2024-07-04T22:14:00.453Z date: 2024-07-04T22:20:13.392Z
tags: tags:
editor: markdown editor: markdown
dateCreated: 2024-06-30T20:44:58.238Z dateCreated: 2024-06-30T20:44:58.238Z
@ -48,4 +48,14 @@ Host github.com or git server
IdentityFile /path/to/privateKey IdentityFile /path/to/privateKey
``` ```
`stat -c %a keyfile` checks permissions of key if needed, must be 600 `stat -c %a keyfile` checks permissions of key if needed, must be 600
`chmod 600 keyfile` `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