TheOdinProject / curriculum

The open curriculum for learning web development
https://www.theodinproject.com/
Other
9.08k stars 12.57k forks source link

Setting up Git: SSH Keygen guide suggested change #28276

Closed hamletfg closed 4 days ago

hamletfg commented 5 days ago

Checks

Describe your suggestion

Preconditions: M1 MacBook Pro using Terminal to set up GitHub SSH Key

I used Setting Up Git guide and it's very good, but there is one part that caused me some confusion (could very well be me) but I was able to figure it out using the official GitHub documentation.

In the GitHub SSH documentation it mentions something not in the Odin's documentation with creating the SSH key the following command:

ssh-keygen -t ed25519 -C "your_email@example.com"

This command worked for me while TOP guide has the same but without the "your_email@example.com" portion and that was causing an issue with my github on terminal and giving me the following error:

the authenticity of host github can't be established

So I created my ssh without the following step:

git config --get user.name
git config --get user.email

and I added the email portion to the ssh-keygen portion and that did the trick. The other parts are great, like the .DS_Store for Mac which did solve that issue for me that I couldn't find other places.

Thanks again for the wonderful work you all are doing!

Path

Foundations

Lesson Url

https://www.theodinproject.com/lessons/foundations-setting-up-git

(Optional) Discord Name

burritosupreme9873

(Optional) Additional Comments

No response

scheals commented 5 days ago

The git configs are unrelated to the SSH key. This is information for your local git install how it should sign your commits.

I'm not exactly clear on what the issue with ssh-keygen -t ed25519 command from TOP was, the issue you saw is mentioned here: image

The GitHub docs are as follows: image

All you had to do is compare the fingerprint and if it matches, type in yes or whatever the terminal told you to do in that case.

In the past, TOP also had ssh-keygen -t ed25519 -C "your_email@example.com" but too many people were confused about the e-mail there, so it was dropped as -C "whatever is here" is just a comment. Usually people use these comments to identify keys if they don't know what they are for.

hamletfg commented 5 days ago

Thanks for the fast reply Scheals, I figured it was something with me the, the fingerprint part was throwing me off and the one with the email ssh-keygen -t ed25519 -C "your_email@example.com" made sense to me, but if it was already tried before and added confusion, then I totally understand going with the method that is on the guide.

I appreciate the explanation you gave me as I'm new to webdev and git.

CouchofTomato commented 4 days ago

Closing as it seems to be resolved