Welcome back to the course, and we are now on lesson six, crash course on Gett and GitHub.
Now, these are very, very important get as a free and open source distributed version control system
designed to handle everything from small to very large projects with a lot of speed and efficiency.
There have been other version control systems in the past, just so you understand what version control
is.
It's basically a process where you can keep track of all of the changes that occur in the files and
folders in your project without having to store a full copy of every single change.
So a full copy of the files and folders.
Whenever a change is made, it also helps you keep track of when those changes were made.
So it's easy to go back to a version of your software before maybe a certain bug was created or something
else happened.
Also, it's easy to see which changes different people make.
So if you're working on a project with multiple people, it can make it very clear who did which change.
And as a result, you can manage your project more efficiently.
So that is what it is.
That's the open source system and it's this set of functions and basically a library of commands that
you can use.
And then there's also GitHub.
Now, GitHub is just one of many hosts.
So it's a it's an actual company, a private company that hosts these projects online to make it much
easier for you to collaborate with these projects with other people.
GitHub is the biggest one.
There's also BitBucket and Get Lab and a number of other hosts that will allow you to store your get
repositories online and then collaborate with other people on those.
So let's take a deeper look at how we can get started with it.
So first of all, we're going to do is actually go to get Hub.
So here is GitHub dot com.
If you create an account, it's pretty easy to do so.
Just put in a user name, email and password and then you can sign up.
I'm going to sign in because I have an account I'm going to sign in here.
And then it's fairly easy to create a new repository, a repository is basically a folder with get enabled
so that you can manage a project.
So here you just choose a name for it.
And I'm just going to give it a description.
And I'm going to keep this one public, I'm going to add a read me file and I will choose a license.
These are optional steps you can skip, but it's very good to have a read me file to describe what your
project is and what it's for.
I'm going to have read my files in multiple folders, in our court documents and GitHub so that you
can see resources for each lesson.
And then we create the repository.
So we have one main branch called Main, and then we have basically all the code that's in here at Initializes
with this README file, it's in marked down markdown is basically a just a rich text document, just
like a text file that uses markdown similar to HTML in order to connect this and then start editing
this and then make it easy for us to edit any files in this project and then upload them back to GitHub.
We're just going to copy this link.
So we just click here on code to copy this link right here and then we're going to go over to our folder.
So I've created a folder here on my computer and I'm just going to clone.
Now, I'm going to get Klown this right here, OK?
And so it cloned that repo, basically, cloning means it's going to download it, it's making a copy,
a clone of that folder onto my computer.
And so now I've got that on my computer, it's here, I can check and notice that all I have inside
this folder is another one I can get into so I can change directory into that one and then see what's
in there.
And not much, just the license and the read me the ones that I created in GitHub.
OK, so now I can do whatever else I want.
I can create new files in here and see I can save them.
Let's just let's do a quick console log.
And then save this as a test.
James.
OK.
And then save that file and now if we lose again.
Now, we have that file right here.
So let's check our get status, OK?
And our guest status command just tells us that, you know, which changes have been made to the repo
locally so that we can compare that with what was already in the project, which is synchronized with
GitHub, dotcom.
So.
This branch is up to date, but there's an entourage file.
Tests that dogs.
So nothing's been added to the comet, so it's not going to synchronise anything online just yet, we
need to do a few more commands to make that happen.
We could also build this file on a branch so we can get checkout dashboard and we can name a branch.
I'll just name it with my name piece Elsworth.
OK, so now we're on a new branch.
And I can create files on that branch.
So I could touch a file and just do.
Test to that G.S..
Go into my test to console that log.
Hey, I'm writing JavaScript.
OK, so we can save that.
We can save that, let's check on our get status.
All right, so let's go ahead and.
Get add that.
What that did is it added those final changes to my rebo.
And now I'm going to get Comet Dash M.
Adding the first commit to the rebuild, so you just put some message there that's descriptive, that
will clarify what code was changed in that first edit.
OK, now I'm going to.
Commit origin on my branch.
And it's going to push those up to GitHub, so let's go take a look at those.
OK, so it immediately showed up in GitHub piece Elsworth, his recent pushes less than a minute ago.
Let's do a compare and pull request.
And let's take a look at these changes.
So of created the pull request.
And we've added to files, test James and test you is great.
All right, so then let's close that poor request.
By merging it, if you had a reviewer and if someone else was reviewing your code, then you wouldn't
be the one to merge the request.
You would add them as a reviewer by adding them as a collaborator on the project in GitHub.
And then you would ask them to do this merge.
If it's confirmed the merge request successfully merged and closed.
OK, so once that's done, you can safely delete the branch or you can keep it open and keep using that
branch in the future.
And there you go.
So now here is the history of poor requests and we can see.
Each individual change made in that poll request, that is a crash course on Git and GitHub in the next
lesson, we're going to talk about some online resources that you're going to want to use just to answer
basically any question that you have about JavaScript.
So in that, we're going to look at three schools at the Mozilla Developer Network and its stack overflow.
All right.
We'll talk to you soon.