So here I'm on GitHub, and on GitHub I'm going to create this new repository, and we call
it Lesson 19 Lab. Let's be more complete, Linux plus Lesson 19 Lab. That's a long name,
but given the popularity of many of my Git repositories, I like to be very specific.
So here it's telling me what to do, and well, I first need to create all of this in my Linux
system, and then I'm just going to run all of these commands. Why wouldn't I copy-paste
them to make it easy? So let's go to Linux. Let me copy these commands, and now I'm going
out of my previous Git repo, and I'm going to use mkdir Linux plus Lesson 19 Lab. Getting
in there and pasting the commands that I just copied from GitHub, and that is taking care
of all the basic information. And okay, there it's coming for the username again. Well,
my username is Sander van Vugt, and my password, ah, do we get that again? And why do we get
that? Well, it is getting this because of the Git remote add. You know what? I'm going
to remove it, and I'm going to do it again, and this time we do it the smart way. So rm
minus rf on Linux plus Lesson 19 Lab, just to make sure that everything is removed. mkdir
Linux plus Lesson 19 Lab. And then in Linux plus Lesson 19 Lab, echo Lesson 19 Lab in
the readme.md. I think that's good enough. Then Git init. I forgot to do my Git init.
And after the Git init, we do what? Well, we need to Git add and Git commit. So Git add
star and Git commit. Minus m new repo commit. Then do I miss anything? Well, we need to
Git the Git branch, and then we have to Git remote add. And the Git branch is still what
we wanted to. Git branch minus m main. So the next command that we have seen in the
output is this. I'm going to paste it to make it a little bit easier. I can't do that because
if I do that, it's going to use HTTPS. That's password-based, and that's wrong. So I need
Git remote add origin. Git add github.com Sander van Vugt slash Linux plus Lesson 19 Lab dot Git.
And why do I do that? Well, I do that because the HTTPS link requires me to log in with the
username and password, and you can't log in with username and password anymore. So
we change that. Remember, this is why we created the SSH keys. So now I can use my Git push
minus u origin main. And uh-oh, something went wrong. Yeah, something went wrong. I made
this error on purpose because this is a very obvious error, and you're going to make that
as well. In the Git URL, you don't have a server name slash. No, you have server name
colon. So there's a colon separating the server and the username. And oh, boy, there it is
telling me remote origin already exists. Yeah, that is right. But fortunately, now we can
use Git remote set URL. I'm going to change the existing remote for origin, and I'm going
to set it to Git at GitHub dot com colon Sander van Vugt slash Linux plus Lesson 19 Lab dot
Git. And now we can try the Git push minus u origin main again. And as you can see, that
is working out all right. Good. That was part one. That was fun, wasn't it? Now we're in
for part two, where I'm going to use Git branch testing and Git checkout testing and
touch four dot txt and five dot txt. And then I'm using echo five dot txt, and I'm writing
it to the dot Git ignore. Next, I'm using Git add star. And there we can see that five
dot txt is ignored. And that is okay. And I'm using Git commit minus m three, whatever
message you want, feel free to replace it with anything. And I'm going to use Git push
minus minus set upstream origin testing, and that is pushing the new branch to upstream so
that my fellow developers can share it as well. Now I'm going to use Git checkout main
and Git merge testing. And now when I use LS, I can see my five dot txt as well as my
four dot txt. And that is what we had in mind for this lab.