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 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:47,000
if I do that, it's going to use HTTPS. That's password based and that's wrong. So I need Git

22
00:02:47,000 --> 00:03:01,720
remote add origin. Git add GitHub.com Sander van Vugt slash Linux plus Lesson 19 Lab.git.

23
00:03:01,720 --> 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:14,039
username and password and you can't log in with username and password anymore. So we

25
00:03:14,039 --> 00:03:23,000
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,800
minus u origin main. And oh, something went wrong. Yeah, something went wrong. I made

27
00:03:29,800 --> 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,839
as well. In the Git URL, you don't have a server name slash. No, you have server name

29
00:03:40,839 --> 00:03:49,880
colon. So there's a colon separating the server and the username. And oh boy, there it is telling

30
00:03:49,880 --> 00:03:57,080
me remote origin already exists. Yeah, that is right. But fortunately now we can use Git remote

31
00:03:57,080 --> 00:04:04,199
set URL. I'm going to change the existing remote for origin and I'm going to set it

32
00:04:04,199 --> 00:04:18,279
to Git at GitHub dot com colon Sander van Vugt slash Linux plus Lesson 19 Lab dot Git.

33
00:04:19,480 --> 00:04:26,040
And now we can try the Git push minus u origin main again. And as you can see, that is working

34
00:04:26,040 --> 00:04:32,359
out all right. Good. That was part one. That was fun, wasn't it? Now we're in for part two,

35
00:04:32,359 --> 00:04:44,679
where I'm going to use Git branch testing and Git checkout testing and touch four dot txt and

36
00:04:44,679 --> 00:04:55,399
five dot txt. And then I'm using echo five dot txt and I'm writing it to the dot Git ignore.

37
00:04:56,040 --> 00:05:06,679
Next I'm using Git add star. And there we can see that five dot txt is ignored. And that is okay.

38
00:05:06,679 --> 00:05:14,920
And I'm using Git commit minus m three, whatever message you want, feel free to replace it with

39
00:05:14,920 --> 00:05:26,440
anything. And I'm going to use Git push minus minus set upstream origin testing. And that is

40
00:05:26,440 --> 00:05:31,880
pushing the new branch to upstream so that my fellow developers can share it as well. Now I'm

41
00:05:31,880 --> 00:05:42,600
going to use Git checkout main and Git merge testing. And now when I use LS, I can see my

42
00:05:42,600 --> 00:05:47,880
five dot txt as well as my four dot txt. And that is what we had in mind for this lab.

