1 00:00:00,090 --> 00:00:04,059 So the next step, a very important one, is to register for GitHub. 2 00:00:04,080 --> 00:00:08,790 So go to GitHub if you don't have an account yet and click sign up. 3 00:00:09,590 --> 00:00:14,210 So then you'll need to come up with a username, an email address and a password. 4 00:00:14,600 --> 00:00:21,200 Make sure that you use a real email address because you will need to verify the email and it's helpful. 5 00:00:21,530 --> 00:00:28,580 Things work better if the email address you use here is the one that you configured very early on in 6 00:00:28,580 --> 00:00:29,030 the course. 7 00:00:29,030 --> 00:00:34,820 If you remember, we did this, let's see, get config user email. 8 00:00:35,960 --> 00:00:42,470 So I'm actually using a special email that GitHub gives me, but basically we won't get to use the same 9 00:00:42,470 --> 00:00:45,650 email address here that we use on GitHub. 10 00:00:45,650 --> 00:00:51,470 I use this weird no reply email just so that I'm not publicly blasting my email address in every git 11 00:00:51,470 --> 00:00:54,680 commit or in every video I do using git. 12 00:00:54,680 --> 00:01:02,120 But it works best if whatever your account email is is also set up locally in your get config. 13 00:01:02,120 --> 00:01:09,020 And that just helps GitHub know who you are when you push up the code, it knows to use your profile 14 00:01:09,020 --> 00:01:12,890 in your image and sort of track your work anyway. 15 00:01:12,890 --> 00:01:18,770 So sign up, use an email, address your username and then the second step once that is done is to configure 16 00:01:18,770 --> 00:01:20,000 an SSH key. 17 00:01:20,090 --> 00:01:27,500 So without going into too much detail, ssh, I believe it stands for Secure Shell is this protocol 18 00:01:27,500 --> 00:01:33,980 that allows us to be authenticated without having to write our email or our username and password every 19 00:01:33,980 --> 00:01:37,490 single time we want to interact with GitHub from the command line. 20 00:01:37,730 --> 00:01:44,360 So what we need to do is generate one of these SSH keys and then tell GitHub about it. 21 00:01:44,360 --> 00:01:50,090 And to do that, we're going to follow the instructions on GitHub that go into detail about how to do 22 00:01:50,090 --> 00:01:50,390 that. 23 00:01:50,390 --> 00:01:55,970 So it depends on the platform you're on, but the first step is to check if you have an SSH key generated 24 00:01:55,970 --> 00:01:56,690 already. 25 00:01:57,260 --> 00:02:03,290 And all you do to figure that out is run this command here so you can just copy this command. 26 00:02:03,290 --> 00:02:08,300 You don't want that dollar sign and this is going to show a whole bunch of it may show a whole bunch 27 00:02:08,300 --> 00:02:16,010 of existing files in a directory called SSH if nothing is in there, or rather if you don't see any 28 00:02:16,010 --> 00:02:23,420 of these ID, RSA Pub, ID, SDK pub, these are all different hashing algorithms. 29 00:02:23,420 --> 00:02:26,390 If you don't see one of these or you just want to make a new key. 30 00:02:26,480 --> 00:02:30,050 If you're brand new to office, you likely don't have any of these files. 31 00:02:30,050 --> 00:02:31,100 It's no big deal. 32 00:02:31,130 --> 00:02:33,530 All we need to do is generate a new key. 33 00:02:33,830 --> 00:02:38,120 So this is where things diverge a bit if you're on a Windows machine versus a mac. 34 00:02:38,120 --> 00:02:42,170 I don't think the differences are that significant, but definitely do it. 35 00:02:42,170 --> 00:02:47,600 Following the tutorial here on GitHub, don't use this video as the source of truth. 36 00:02:47,600 --> 00:02:48,830 Things change quickly. 37 00:02:48,830 --> 00:02:52,940 I'll include it as one of the resources, so I'll go through this process. 38 00:02:52,940 --> 00:02:55,580 I've already set up an SSH key, but I'll do the same thing. 39 00:02:55,580 --> 00:03:01,700 So we're going to copy this right here, and then we put our email in there and that will act as our 40 00:03:01,700 --> 00:03:02,360 label. 41 00:03:02,810 --> 00:03:04,460 So I'm going to go to my terminal. 42 00:03:05,540 --> 00:03:06,620 And I'm going to run this. 43 00:03:06,620 --> 00:03:09,860 And then in quotes, I'm just going to use this email here. 44 00:03:09,860 --> 00:03:11,960 This is the one I use for get and GitHub. 45 00:03:13,030 --> 00:03:13,470 Okay. 46 00:03:13,480 --> 00:03:17,470 And then it's going to ask me for a file where it should save that key. 47 00:03:17,560 --> 00:03:22,750 So this is the default file name and the default location and this dot ssh folder. 48 00:03:23,260 --> 00:03:25,790 If you just hit enter, it's going to use that. 49 00:03:25,810 --> 00:03:28,810 You can also come up with your own file name if you want. 50 00:03:28,840 --> 00:03:32,770 However, all the GitHub tutorials use this name. 51 00:03:32,770 --> 00:03:35,410 ID underscore ID 25519. 52 00:03:35,410 --> 00:03:36,910 So I'm just going to go with that. 53 00:03:37,000 --> 00:03:42,820 I'm going to hit enter and then enter a passphrase so you can type that passphrase and then enter the 54 00:03:42,820 --> 00:03:44,140 same passphrase again. 55 00:03:44,560 --> 00:03:45,070 All right. 56 00:03:45,070 --> 00:03:52,480 So then it tells me that my ID has been saved in this file and my public key has been saved in a similar 57 00:03:52,480 --> 00:03:54,460 file, but it ends in dot pub. 58 00:03:54,490 --> 00:03:55,510 It's the public key. 59 00:03:55,720 --> 00:04:00,240 I'm not going into detail explaining how this stuff works because it doesn't really matter at this point. 60 00:04:00,250 --> 00:04:01,570 We just want to get it set up. 61 00:04:01,780 --> 00:04:06,970 So the next step is to then add the SSH key to the SSH agent. 62 00:04:07,120 --> 00:04:12,040 So we're going to copy this line if you're on a mac and there are some instructions depending on the 63 00:04:12,040 --> 00:04:15,220 MAC OS operating system, I guess that's what OS is. 64 00:04:15,370 --> 00:04:19,630 Depending on the version that you're running, you may need to make some additional changes. 65 00:04:19,630 --> 00:04:21,220 So I'm going to try this here. 66 00:04:22,540 --> 00:04:24,430 So that looks like it's working fine. 67 00:04:24,700 --> 00:04:31,210 So the next step on a mac is to check if we have this file called config in the SSH directory so we 68 00:04:31,210 --> 00:04:36,580 can see if it exists and if it doesn't exist, you can run this command to make it so if you get this 69 00:04:36,580 --> 00:04:38,540 line that says it does not exist. 70 00:04:38,560 --> 00:04:40,630 Try this one to make that file. 71 00:04:41,200 --> 00:04:44,080 And again, this is only if you're on a newer Mac. 72 00:04:44,080 --> 00:04:48,610 And then here we need to open that file and then put this right here. 73 00:04:48,610 --> 00:04:51,040 Just copy this and put that in the file. 74 00:04:51,490 --> 00:04:56,020 Now, if you gave your file name when you generated the keys, if you gave it a different name from 75 00:04:56,020 --> 00:04:58,810 the default, you'll need to reflect that name here. 76 00:04:58,810 --> 00:05:02,890 But I'm just going with what they have on the documentation, so I'm going to paste that in. 77 00:05:02,920 --> 00:05:04,180 Hopefully you can see this. 78 00:05:05,480 --> 00:05:06,380 And safe. 79 00:05:06,380 --> 00:05:10,040 So that was the name of my file, if you remember right here. 80 00:05:10,250 --> 00:05:12,710 This is what I said to save it as it just hit enter. 81 00:05:12,740 --> 00:05:17,060 So that matches this right here coming from the GitHub docs. 82 00:05:17,150 --> 00:05:23,330 Also, if you elected to use a passcode, when you generate the key, you'll want this line. 83 00:05:23,330 --> 00:05:26,270 And if you did not use a passcode, you don't want that line. 84 00:05:26,300 --> 00:05:33,290 Now, the final step here is well, the final step before we go to GitHub is to copy this line, which 85 00:05:33,290 --> 00:05:37,780 is to add our key to something called the SSH agent, which we just started up. 86 00:05:37,790 --> 00:05:43,160 And if we do this again, you need to make sure you're using the correct file name that matches the 87 00:05:43,160 --> 00:05:44,570 file name you generated. 88 00:05:44,570 --> 00:05:46,550 But again, this is the default. 89 00:05:46,550 --> 00:05:49,040 So if you didn't deviate, this is all you need to do. 90 00:05:49,490 --> 00:05:50,900 We'll run this line. 91 00:05:52,010 --> 00:05:53,560 Identity added. 92 00:05:53,570 --> 00:05:59,750 So now the final step is to go to GitHub and add that SSH key to the GitHub account. 93 00:06:00,480 --> 00:06:06,000 So what we need to do is copy the contents of the key that was generated, the public key. 94 00:06:06,240 --> 00:06:10,980 So again, just copy this line if you're using the same name and you didn't modify it. 95 00:06:12,150 --> 00:06:19,590 You won't see any outputs, but this command PB copy copies the output of this into your clipboard. 96 00:06:19,590 --> 00:06:22,110 So on the clipboard right now I have this key here. 97 00:06:22,960 --> 00:06:24,130 So I got that. 98 00:06:24,130 --> 00:06:30,430 I have access to it and now I need to go on to GitHub and go to my profile. 99 00:06:30,460 --> 00:06:34,900 A little profile photo up top and then go to settings I believe is what it is. 100 00:06:35,350 --> 00:06:36,530 Super zoomed in here. 101 00:06:36,550 --> 00:06:37,260 Here we are. 102 00:06:37,270 --> 00:06:41,170 And then I click on SSH and then I'll add a new key. 103 00:06:41,170 --> 00:06:42,630 So I'll just demonstrate this. 104 00:06:42,660 --> 00:06:51,010 I go to GitHub, here's my profile, I'm going to go to settings and then SSH and GPG keys and then 105 00:06:51,010 --> 00:06:53,080 I'm going to click new ssh key. 106 00:06:53,890 --> 00:06:54,780 Just like that. 107 00:06:54,790 --> 00:06:56,380 And then I'm going to paste this in. 108 00:06:57,290 --> 00:07:02,840 The thing I copied from the clipboard over here or copied to my clipboard and then give it a title. 109 00:07:02,840 --> 00:07:06,730 Just like laptop, for example, or my key. 110 00:07:06,740 --> 00:07:07,850 It doesn't matter. 111 00:07:09,850 --> 00:07:11,380 And I'm going to add it. 112 00:07:11,740 --> 00:07:12,430 All right. 113 00:07:12,430 --> 00:07:14,230 So we should be good to go now. 114 00:07:14,710 --> 00:07:20,380 I know it's an obnoxious process, but once we have it done, you really don't ever have to do it again, 115 00:07:20,410 --> 00:07:21,850 at least not on this machine. 116 00:07:22,090 --> 00:07:26,890 With that said, I'm going to do it again after recording this video, but we should have a key set 117 00:07:26,890 --> 00:07:30,970 up and we'll know if it works or not when we try pushing in the next couple of videos.