Skip to content

Commit 2117056

Browse files
committed
differences for PR #1088
1 parent f7214a8 commit 2117056

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

07-github.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,36 @@ ls: cannot access '/c/Users/Alfredo/.ssh': No such file or directory
168168
If SSH has been set up on the computer you're using, the public and private key pairs will be listed. The file names are either `id_ed25519`/`id_ed25519.pub` or `id_rsa`/`id_rsa.pub` depending on how the key pairs were set up.
169169
Since they don't exist on Alfredo's computer, he uses this command to create them.
170170

171+
::::::::::::::::::::::::::::::::::::::::: spoiler
172+
173+
## Resolving SSH Key Conflicts: Custom Names and Paths
174+
175+
If you need to create an SSH key pair with a custom name or store it in a non-default location (e.g., because a default-named key like id_ed25519 already exists), Git may not automatically use it when pushing or pulling from GitHub.
176+
177+
One solution is to add a GitHub entry to your SSH config.
178+
179+
Open or create the SSH config file:
180+
181+
```bash
182+
183+
$ nano ~/.ssh/config
184+
```
185+
186+
Add an entry for GitHub, replacing the path with your key’s actual name and location:
187+
188+
```
189+
Host github.com
190+
HostName github.com
191+
User git
192+
IdentityFile ~/<full_path_to_SSH_key_file>/<key_name>
193+
IdentitiesOnly yes
194+
```
195+
196+
Save and exit. Now Git will use the correct key when pushing to GitHub.
197+
198+
::::::::::::::::::::::::::::::::::::::::::::::::::
199+
200+
171201
### 3\.1 Create an SSH key pair
172202

173203
To create an SSH key pair Alfredo uses this command, where the `-t` option specifies which type of algorithm to use and `-C` attaches a comment to the key (here, Alfredo's email):

md5sum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"episodes/04-changes.md" "10b891940dec94a412a779a1d749a66b" "site/built/04-changes.md" "2025-05-19"
1010
"episodes/05-history.md" "1db0ac027bd51d7d67562d71a60116c8" "site/built/05-history.md" "2025-01-10"
1111
"episodes/06-ignore.md" "ff0a74d69b9f3bf60795226eb0e6a6bd" "site/built/06-ignore.md" "2025-04-01"
12-
"episodes/07-github.md" "8f7083251bc0e76a78afcc582f5cc03f" "site/built/07-github.md" "2025-03-31"
12+
"episodes/07-github.md" "3fb726f8778cafc2fac05e977c488482" "site/built/07-github.md" "2025-05-27"
1313
"episodes/08-collab.md" "26c15a5971a7caef2daf17c84e72d3c9" "site/built/08-collab.md" "2024-09-29"
1414
"episodes/09-conflict.md" "f50920c3da4791a58f81f7fc330a03b0" "site/built/09-conflict.md" "2025-04-15"
1515
"episodes/10-open.md" "9701759e294a60cd809f51991e41a462" "site/built/10-open.md" "2025-03-04"

0 commit comments

Comments
 (0)