1 00:00:00,000 --> 00:00:13,320 So here I'm on GitHub, and on GitHub I'm going to create this new repository, and we call 2 00:00:13,320 --> 00:00:26,280 it Lesson 19 Lab. Let's be more complete, Linux plus Lesson 19 Lab. That's a long name, 3 00:00:26,280 --> 00:00:33,639 but given the popularity of many of my Git repositories, I like to be very specific. 4 00:00:33,639 --> 00:00:39,959 So here it's telling me what to do, and well, I first need to create all of this in my Linux 5 00:00:39,959 --> 00:00:44,840 system, and then I'm just going to run all of these commands. Why wouldn't I copy-paste 6 00:00:44,840 --> 00:00:51,560 them to make it easy? So let's go to Linux. Let me copy these commands, and now I'm going 7 00:00:51,560 --> 00:01:03,840 out of my previous Git repo, and I'm going to use mkdir Linux plus Lesson 19 Lab. Getting 8 00:01:03,840 --> 00:01:11,400 in there and pasting the commands that I just copied from GitHub, and that is taking care 9 00:01:11,400 --> 00:01:17,519 of all the basic information. And okay, there it's coming for the username again. Well, 10 00:01:17,519 --> 00:01:24,480 my username is Sander van Vugt, and my password, ah, do we get that again? And why do we get 11 00:01:24,480 --> 00:01:31,000 that? Well, it is getting this because of the Git remote add. You know what? I'm going 12 00:01:31,000 --> 00:01:36,480 to remove it, and I'm going to do it again, and this time we do it the smart way. So rm 13 00:01:36,480 --> 00:01:43,800 minus rf on Linux plus Lesson 19 Lab, just to make sure that everything is removed. mkdir 14 00:01:43,800 --> 00:01:56,120 Linux plus Lesson 19 Lab. And then in Linux plus Lesson 19 Lab, echo Lesson 19 Lab in 15 00:01:56,120 --> 00:02:05,879 the readme.md. I think that's good enough. Then Git init. I forgot to do my Git init. 16 00:02:05,879 --> 00:02:12,559 And after the Git init, we do what? Well, we need to Git add and Git commit. So Git add 17 00:02:12,559 --> 00:02:23,320 star and Git commit. Minus m new repo commit. Then do I miss anything? Well, we need to 18 00:02:23,320 --> 00:02:28,679 Git the Git branch, and then we have to Git remote add. And the Git branch is still what 19 00:02:28,679 --> 00:02:35,479 we wanted to. Git branch minus m main. So the next command that we have seen in the 20 00:02:35,479 --> 00:02:41,559 output is this. I'm going to paste it to make it a little bit easier. I can't do that because 21 00:02:41,639 --> 00:02:46,679 if I do that, it's going to use HTTPS. That's password-based, and that's wrong. So I need 22 00:02:46,679 --> 00:03:01,639 Git remote add origin. Git add github.com Sander van Vugt slash Linux plus Lesson 19 Lab dot Git. 23 00:03:01,639 --> 00:03:08,360 And why do I do that? Well, I do that because the HTTPS link requires me to log in with the 24 00:03:08,360 --> 00:03:13,919 username and password, and you can't log in with username and password anymore. So 25 00:03:13,919 --> 00:03:23,000 we change that. Remember, this is why we created the SSH keys. So now I can use my Git push 26 00:03:23,000 --> 00:03:29,839 minus u origin main. And uh-oh, something went wrong. Yeah, something went wrong. I made 27 00:03:29,839 --> 00:03:34,679 this error on purpose because this is a very obvious error, and you're going to make that 28 00:03:34,679 --> 00:03:40,880 as well. In the Git URL, you don't have a server name slash. No, you have server name 29 00:03:40,880 --> 00:03:49,639 colon. So there's a colon separating the server and the username. And oh, boy, there it is 30 00:03:49,639 --> 00:03:55,600 telling me remote origin already exists. Yeah, that is right. But fortunately, now we can 31 00:03:55,600 --> 00:04:03,440 use Git remote set URL. I'm going to change the existing remote for origin, and I'm going 32 00:04:03,520 --> 00:04:18,040 to set it to Git at GitHub dot com colon Sander van Vugt slash Linux plus Lesson 19 Lab dot 33 00:04:18,040 --> 00:04:25,600 Git. And now we can try the Git push minus u origin main again. And as you can see, that 34 00:04:25,600 --> 00:04:31,200 is working out all right. Good. That was part one. That was fun, wasn't it? Now we're in 35 00:04:31,200 --> 00:04:41,200 for part two, where I'm going to use Git branch testing and Git checkout testing and 36 00:04:41,200 --> 00:04:52,119 touch four dot txt and five dot txt. And then I'm using echo five dot txt, and I'm writing 37 00:04:52,119 --> 00:05:02,720 it to the dot Git ignore. Next, I'm using Git add star. And there we can see that five 38 00:05:02,720 --> 00:05:12,399 dot txt is ignored. And that is okay. And I'm using Git commit minus m three, whatever 39 00:05:12,399 --> 00:05:18,559 message you want, feel free to replace it with anything. And I'm going to use Git push 40 00:05:18,559 --> 00:05:28,799 minus minus set upstream origin testing, and that is pushing the new branch to upstream so 41 00:05:28,799 --> 00:05:35,760 that my fellow developers can share it as well. Now I'm going to use Git checkout main 42 00:05:37,160 --> 00:05:44,279 and Git merge testing. And now when I use LS, I can see my five dot txt as well as my 43 00:05:44,279 --> 00:05:47,880 four dot txt. And that is what we had in mind for this lab.