0:00:06.050,0:00:09.669 In this lesson we're going to [br]be creating a GitHub account. 0:00:10.160,0:00:12.676 We'll follow that up by creating [br]a repository. 0:00:13.248,0:00:19.023 We’ll then add to our local environment [br]the command line interface for Git. 0:00:19.540,0:00:23.727 We’ll generate some keys, and we’ll use[br]those keys to add them back 0:00:23.778,0:00:25.855 into the online GitHub account 0:00:26.249,0:00:29.230 in order for us to get access[br]from our local environment. 0:00:29.582,0:00:33.783 We’ll then clone the repository we[br]created to our local machine. 0:00:34.109,0:00:37.847 We’ll add a file, and ultimately, to[br]close it all off, 0:00:38.217,0:00:42.506 we will commit push those changes back [br]into the GitHub repository. 0:00:42.750,0:00:44.468 So we're going to go full cycle. 0:00:44.980,0:00:46.347 So let's go ahead and get started. 0:00:47.565,0:00:51.645 We'll go ahead and navigate to[br]github.com. 0:00:53.458,0:00:57.593 I'm going to go ahead and choose[br]a username here. 0:01:01.371,0:01:04.915 I'll go with abeluserman. 0:01:06.808,0:01:13.697 I'll set an email of[br]abel_user@hotmail.com. 0:01:14.781,0:01:17.096 And I’ll select a secret password. 0:01:22.686,0:01:25.048 Let's go ahead and click now on Sign up. 0:01:29.645,0:01:32.392 We’ll go ahead and go with the [br]free plan. 0:01:36.748,0:01:38.523 We can go ahead and skip this screen. 0:01:40.660,0:01:44.510 And as you can see there,[br]you can go ahead and start a project. 0:01:46.590,0:01:47.972 Let's go ahead and click on that. 0:01:49.302,0:01:51.933 And it's asking me to verify my email [br]address. 0:01:54.302,0:01:56.753 When you go to your account, [br]if you can't find it, 0:01:56.753,0:02:00.150 look for it under junk email, [br]like in my case. 0:02:00.600,0:02:03.649 I'm going to go ahead and[br]verify that email address. 0:02:04.542,0:02:08.394 And as you can see there, we’re back[br]in GitHub. 0:02:09.107,0:02:11.950 So it is asking me here for a [br]repository name. 0:02:14.895,0:02:16.534 I'll go ahead and call it “kali”. 0:02:17.704,0:02:19.382 I'll enter a description here, 0:02:20.131,0:02:22.115 just call it “Dummy Repo”. 0:02:24.284,0:02:26.217 I'll go ahead and leave it as public. 0:02:28.720,0:02:31.159 I will initialize it with a[br]README, 0:02:31.159,0:02:34.265 that way we can go ahead and [br]clone at as soon as we're done. 0:02:35.125,0:02:37.993 I'll go ahead and add a .gitignore file. 0:02:38.267,0:02:41.860 For our case, since we’ll be mostly[br]writing JavaScript files, 0:02:41.896,0:02:46.220 I'll go ahead and use the Node gitignore. 0:02:46.308,0:02:51.385 This is simply done to ignore files that [br]would not be copied over 0:02:51.385,0:02:52.649 by your entire team, 0:02:52.649,0:02:57.857 to simply ignore some of the files that[br]fit that pattern within Node. 0:02:58.252,0:03:00.011 Then, I’m then going to[br]add a license. 0:03:00.598,0:03:03.418 If you're not familiar with open source[br]licenses, 0:03:03.772,0:03:05.859 the MIT License is the most permissive. 0:03:05.859,0:03:09.451 That means there are no restrictions, [br]commercial or otherwise. 0:03:09.851,0:03:11.913 So I'm going to go ahead and create [br]it now. 0:03:15.941,0:03:18.947 And as you can see there, we[br]have a repository. 0:03:19.830,0:03:23.662 So we're ready to go when it comes [br]to having something 0:03:24.002,0:03:28.070 on GitHub that we can clone to our local[br]environment. 0:03:28.107,0:03:32.859 Now the next step is we're going to [br]set up our local environment 0:03:32.905,0:03:34.285 that is within the machine. 0:03:35.923,0:03:38.783 To do that, we're going to go[br]ahead and navigate to 0:03:38.787,0:03:45.632 git-scm.com/downloads. 0:03:46.368,0:03:52.901 As you can see there, it's one of the ones[br]that the pull down suggestions is showing. 0:03:53.577,0:04:00.124 And from here, we're simply going to[br]select the Windows version. 0:04:02.165,0:04:06.851 As you can see there, that content, or[br]that installer, is already downloading. 0:04:10.760,0:04:11.527 There we go. 0:04:11.590,0:04:13.270 The file has downloaded. 0:04:13.270,0:04:14.742 Let's go ahead and execute it. 0:04:32.443,0:04:36.003 I'm gonna go ahead and select[br]“Additional icons” in this case. 0:04:46.959,0:04:49.114 I'm going to go ahead and[br]go with the default. 0:05:03.117,0:05:05.760 Now let's go ahead and launch [br]the Git Bash. 0:05:13.103,0:05:15.103 Let's go ahead and[br]make that window bigger. 0:05:16.301,0:05:17.980 OK, now we have a nice window. 0:05:17.980,0:05:23.493 Let's go ahead and add the username [br]for the GitHub, 0:05:23.537,0:05:26.092 for the git environment, [br]local git environment. 0:05:26.805,0:05:35.176 So we're going to enter[br]“git config --global user.name”. 0:05:37.336,0:05:38.365 And in this case, 0:05:41.931,0:05:46.103 my username is abeluserman. 0:05:47.641,0:05:48.891 Let's go ahead and hit Return. 0:05:50.291,0:05:51.726 We’ll next enter 0:05:55.809,0:05:56.696 my email. 0:06:01.656,0:06:09.896 And in this case, it will be[br]abel_user@hotmail.com. 0:06:12.127,0:06:15.861 We’ll next create a key that will[br]generate locally 0:06:15.920,0:06:19.989 and then we will copy over to the GitHub[br]environment. 0:06:20.864,0:06:28.079 And we do that by entering “ssh-keygen”. 0:06:30.657,0:06:33.591 We'll go ahead and enter, we’ll go[br]with the defaults again. 0:06:34.560,0:06:36.310 We will not set a passphrase. 0:06:37.435,0:06:40.772 And as you can see there, that[br]key has been created. 0:06:42.031,0:06:44.534 Next we’ll inspect that[br]key at the command line. 0:06:49.238,0:06:51.025 Let's go ahead and copy that key. 0:06:55.346,0:06:57.496 Now that we have the key in our[br]clipboard, 0:06:57.496,0:07:01.234 let's go ahead and go back to our account. 0:07:02.088,0:07:05.074 And let's go ahead and choose[br]the repository. 0:07:05.307,0:07:06.892 Well actually, we don't need to do that, 0:07:06.892,0:07:13.171 we can simply select the account pull [br]down there, the profile. 0:07:13.546,0:07:16.495 And let's go ahead and go to SSH keys. 0:07:17.135,0:07:20.756 And we’ll go ahead and[br]add a new SSH key. 0:07:21.219,0:07:29.102 We’ll call this “Windows Client VM”,[br]that's what this is. 0:07:29.718,0:07:35.797 I'm going to go ahead and paste here[br]the...nope. 0:07:36.795,0:07:38.841 Let me go ahead and paste the key. 0:07:40.637,0:07:43.042 And I'm gonna go ahead and add it. 0:07:46.924,0:07:48.923 Now let's go ahead and go back[br]to the Bash. 0:07:54.827,0:07:56.611 Let's go ahead and “clear”[br]the screen. 0:08:00.027,0:08:02.482 Let's go ahead and create a development[br]directory. 0:08:04.679,0:08:05.459 Call it “dev”. 0:08:06.878,0:08:08.033 “cd” into that. 0:08:09.835,0:08:12.554 So as you can see there, that's[br]what the path is now. 0:08:15.103,0:08:16.915 I've gone ahead and cleared the[br]screen. 0:08:16.915,0:08:19.738 Now we're going to go ahead and clone [br]that repository. 0:08:19.773,0:08:22.777 We do that by entering “git clone”, 0:08:23.075,0:08:26.925 and we're going to get the address[br]from a repository. 0:08:27.190,0:08:29.871 Let me go ahead and navigate to that now. 0:08:30.568,0:08:33.493 So it's just going to be abeluserman. 0:08:35.563,0:08:39.534 And I’m gonna click on the name[br]of the repository. 0:08:40.328,0:08:46.619 Then on “Clone or download” [br]and we're going to use the git address. 0:08:46.664,0:08:48.663 We're going to copy that to our clipboard. 0:08:49.467,0:08:51.398 Now I'm going to go ahead and 0:08:51.484,0:08:54.408 make sure I'm in the right spot [br]and paste that here. 0:08:55.579,0:08:57.481 And I'm going to go ahead[br]and hit Return. 0:08:59.720,0:09:02.170 If all goes well, we should pull[br]down those files. 0:09:02.647,0:09:05.768 So go ahead and look at the [br]directory structure. 0:09:05.768,0:09:08.167 And yes, we see "kali" there now. 0:09:08.167,0:09:10.438 Let's go ahead and enter into it. 0:09:11.564,0:09:15.369 And you can see there that we[br]have the files from the repository. 0:09:15.889,0:09:19.997 If we enter “ls” with a “-a” option, [br]we can see there that we have 0:09:20.550,0:09:22.945 the .gitignore as well. 0:09:23.819,0:09:25.487 So now, the next thing we're[br]going to do 0:09:25.487,0:09:28.739 is that we're going to add [br]a file to that repository. 0:09:29.576,0:09:33.712 Let's go ahead and open our file system. 0:09:34.436,0:09:39.907 And you can see there I am[br]already inside of the path. 0:09:40.377,0:09:46.246 I'm going to go ahead and select[br]kali, and I will simply add a new file. 0:09:46.623,0:09:48.265 Let's go ahead and do that. 0:09:49.502,0:09:50.700 We'll call it “hello”. 0:09:52.511,0:09:54.152 We’ll go ahead and open it. 0:09:54.609,0:09:59.243 And I think I used the wrong key. 0:09:59.718,0:10:00.359 There we go. 0:10:01.080,0:10:03.860 Let's go say, go ahead and say [br]“Hello World!” 0:10:05.139,0:10:06.226 Go ahead and close it. 0:10:07.866,0:10:08.485 Save it. 0:10:09.691,0:10:13.515 And now we've added[br]a file to our repository. 0:10:14.126,0:10:18.728 If we enter “git status” it'll say that 0:10:18.775,0:10:21.561 we have a new file that has not been [br]added. 0:10:21.817,0:10:23.843 We can now go ahead and add that. 0:10:24.558,0:10:25.507 We’ll say “add”. 0:10:25.694,0:10:30.725 If you do “.” you simply[br]add all of the files in your directory. 0:10:31.166,0:10:34.993 I'm simply going to[br]enter “hello” in this case “.txt”. 0:10:35.408,0:10:44.648 Now if we do “git status”, you'll see [br]that there is a new file now 0:10:45.220,0:10:46.784 that has been added. 0:10:46.993,0:10:50.726 The next thing we’ll do is we’ll enter [br]a git commit 0:10:52.947,0:10:55.174 with the “-m” option. 0:10:55.539,0:10:58.198 We need to provide some feedback. 0:10:58.731,0:11:06.024 And in this case, I'll say simply[br]“added hello.txt”. 0:11:08.270,0:11:12.439 Hit Return, and now we're ready[br]to push to the directory. 0:11:14.218,0:11:19.023 We'll go ahead and enter “git push”, [br]and this is the point in where, 0:11:19.179,0:11:22.934 if we added our keys correctly [br]and everything has been done correctly, 0:11:23.172,0:11:25.483 we will be able to see the commit. 0:11:25.725,0:11:27.249 Let's go ahead and enter Return. 0:11:31.379,0:11:35.633 And yes, you can see there that [br]the push was successful. 0:11:35.957,0:11:39.121 Let's go ahead and go over to our[br]repository. 0:11:39.982,0:11:41.887 And let's go ahead and reload the page. 0:11:43.395,0:11:46.406 If all went well, we[br]should be able to see our “hello”. 0:11:46.832,0:11:48.376 Now, if we click on it, 0:11:49.742,0:11:51.884 we should be able to see what we wrote. 0:11:53.562,0:11:58.732 And so if we review upon review what we [br]did, we created a GitHub account. 0:11:58.880,0:12:01.205 We then created a repository. 0:12:01.792,0:12:05.843 We then installed the “git cli”,[br]the command line interface. 0:12:05.843,0:12:07.475 We generated some keys. 0:12:08.029,0:12:11.347 We added that key that we generated, the[br]public key, 0:12:11.347,0:12:16.586 to the GitHub repository -- well not just [br]to the repository, but to the account. 0:12:17.184,0:12:20.569 We then cloned a repository to our[br]local machine. 0:12:20.763,0:12:23.700 We added a file and, as the last step, 0:12:23.700,0:12:26.752 we committed and pushed those [br]changes to the repository. 0:12:27.258,0:12:29.613 Go ahead and practice this a little bit. 0:12:29.958,0:12:34.218 Go through the cycle a couple times,[br]especially that of creating a repository, 0:12:34.222,0:12:37.959 cloning it to your local environment, [br]adding a file or two, 0:12:38.230,0:12:40.789 and then committing,[br]pushing those changes.