So the next step, a very important one, is to register for GitHub.
So go to GitHub if you don't have an account yet and click sign up.
So then you'll need to come up with a username, an email address and a password.
Make sure that you use a real email address because you will need to verify the email and it's helpful.
Things work better if the email address you use here is the one that you configured very early on in
the course.
If you remember, we did this, let's see, get config user email.
So I'm actually using a special email that GitHub gives me, but basically we won't get to use the same
email address here that we use on GitHub.
I use this weird no reply email just so that I'm not publicly blasting my email address in every git
commit or in every video I do using git.
But it works best if whatever your account email is is also set up locally in your get config.
And that just helps GitHub know who you are when you push up the code, it knows to use your profile
in your image and sort of track your work anyway.
So sign up, use an email, address your username and then the second step once that is done is to configure
an SSH key.
So without going into too much detail, ssh, I believe it stands for Secure Shell is this protocol
that allows us to be authenticated without having to write our email or our username and password every
single time we want to interact with GitHub from the command line.
So what we need to do is generate one of these SSH keys and then tell GitHub about it.
And to do that, we're going to follow the instructions on GitHub that go into detail about how to do
that.
So it depends on the platform you're on, but the first step is to check if you have an SSH key generated
already.
And all you do to figure that out is run this command here so you can just copy this command.
You don't want that dollar sign and this is going to show a whole bunch of it may show a whole bunch
of existing files in a directory called SSH if nothing is in there, or rather if you don't see any
of these ID, RSA Pub, ID, SDK pub, these are all different hashing algorithms.
If you don't see one of these or you just want to make a new key.
If you're brand new to office, you likely don't have any of these files.
It's no big deal.
All we need to do is generate a new key.
So this is where things diverge a bit if you're on a Windows machine versus a mac.
I don't think the differences are that significant, but definitely do it.
Following the tutorial here on GitHub, don't use this video as the source of truth.
Things change quickly.
I'll include it as one of the resources, so I'll go through this process.
I've already set up an SSH key, but I'll do the same thing.
So we're going to copy this right here, and then we put our email in there and that will act as our
label.
So I'm going to go to my terminal.
And I'm going to run this.
And then in quotes, I'm just going to use this email here.
This is the one I use for get and GitHub.
Okay.
And then it's going to ask me for a file where it should save that key.
So this is the default file name and the default location and this dot ssh folder.
If you just hit enter, it's going to use that.
You can also come up with your own file name if you want.
However, all the GitHub tutorials use this name.
ID underscore ID 25519.
So I'm just going to go with that.
I'm going to hit enter and then enter a passphrase so you can type that passphrase and then enter the
same passphrase again.
All right.
So then it tells me that my ID has been saved in this file and my public key has been saved in a similar
file, but it ends in dot pub.
It's the public key.
I'm not going into detail explaining how this stuff works because it doesn't really matter at this point.
We just want to get it set up.
So the next step is to then add the SSH key to the SSH agent.
So we're going to copy this line if you're on a mac and there are some instructions depending on the
MAC OS operating system, I guess that's what OS is.
Depending on the version that you're running, you may need to make some additional changes.
So I'm going to try this here.
So that looks like it's working fine.
So the next step on a mac is to check if we have this file called config in the SSH directory so we
can see if it exists and if it doesn't exist, you can run this command to make it so if you get this
line that says it does not exist.
Try this one to make that file.
And again, this is only if you're on a newer Mac.
And then here we need to open that file and then put this right here.
Just copy this and put that in the file.
Now, if you gave your file name when you generated the keys, if you gave it a different name from
the default, you'll need to reflect that name here.
But I'm just going with what they have on the documentation, so I'm going to paste that in.
Hopefully you can see this.
And safe.
So that was the name of my file, if you remember right here.
This is what I said to save it as it just hit enter.
So that matches this right here coming from the GitHub docs.
Also, if you elected to use a passcode, when you generate the key, you'll want this line.
And if you did not use a passcode, you don't want that line.
Now, the final step here is well, the final step before we go to GitHub is to copy this line, which
is to add our key to something called the SSH agent, which we just started up.
And if we do this again, you need to make sure you're using the correct file name that matches the
file name you generated.
But again, this is the default.
So if you didn't deviate, this is all you need to do.
We'll run this line.
Identity added.
So now the final step is to go to GitHub and add that SSH key to the GitHub account.
So what we need to do is copy the contents of the key that was generated, the public key.
So again, just copy this line if you're using the same name and you didn't modify it.
You won't see any outputs, but this command PB copy copies the output of this into your clipboard.
So on the clipboard right now I have this key here.
So I got that.
I have access to it and now I need to go on to GitHub and go to my profile.
A little profile photo up top and then go to settings I believe is what it is.
Super zoomed in here.
Here we are.
And then I click on SSH and then I'll add a new key.
So I'll just demonstrate this.
I go to GitHub, here's my profile, I'm going to go to settings and then SSH and GPG keys and then
I'm going to click new ssh key.
Just like that.
And then I'm going to paste this in.
The thing I copied from the clipboard over here or copied to my clipboard and then give it a title.
Just like laptop, for example, or my key.
It doesn't matter.
And I'm going to add it.
All right.
So we should be good to go now.
I know it's an obnoxious process, but once we have it done, you really don't ever have to do it again,
at least not on this machine.
With that said, I'm going to do it again after recording this video, but we should have a key set
up and we'll know if it works or not when we try pushing in the next couple of videos.