In this video, let's put into practice the gift commands that we discussed in the previous video.
So the objective for this video is that we are going to create a sample project and we will see how
we are going to keep versions of that project and also how we can take that project and put it on GitHub.
So before we continue, make sure that you have GitHub account.
And for this one, I showed you how we can create GitHub account in the previous section.
And also we need to know some of the terminal commands.
Good.
So let's go start it.
The first step is let's go ahead and create our folder or our project and I'll call this one as gets
projects.
It can be anything.
Then I'll hit enter and you can see that it has been created here.
At this point, this is a normal folder.
There is nothing about Gates because I can right click and then also create a new folder dude.
After that, I need to see the end to that folder called Get Projects.
Let me clear my terminal.
Perfect.
The next step is that we need to configure gates.
And here we go.
We make use of gates, space config, space dash, dash, global, and then user dot username and then
space you provide the username.
So I'm going to make my -- coat take.
Cinco and coat and our hit Enter the next configuration is going to be my email.
The same process gets config.
Dash dash global and space user dot email.
For this one, we don't provide any code, so I'll provide this email code to cleanco at gmail.
Dot com and our hit Enter.
Now I have finished configuring my gates.
The next step is I want to see the configured file and I told you we are going to use what is called
gate config list.
This is what we have used.
So now let's see gate.
Fake.
Let me clear the terminal first.
Gates config dash dash lists now hit enter and you can see that this is my configured file.
Next is if I want to exit from this terminal in a key I press.
It doesn't work.
So to be able to exit, press colon and then queue and you are good to go.
The next step is we need to initialize our projects as git, which is really important and we are going
to use this command called Gates in it.
So back to my terminal.
Make use of gates and then init hit enter and you can see that initialize empty git repository.
Meaning I have initialized my project as gates.
If I open it.
Well, you can see that we have a file in it called Gates and on Mark.
If you cannot see this file, it means that your files are hidden.
So press shaped command and period.
And then we're going to talk it as that.
You can see how I'm toggling the file.
So if you open the file, you can see we have copied files inside, but don't tamper with it.
That is why by default Mac users, it is hidden.
So let me hide it.
So now we have configured our project to use Git.
So what is the next step?
Well, I can open this project inside Visual Studio code and start developing my application.
So for this project, let's say we are developing a simple application with one file.
So let's create one file called Touch and I'll call my ask app.
You can create any file, so let's open this project inside Visual Studio code.
Now I'm keeping track of my project.
Did you get it?
Yes.
Now let's see how we are going to keep track.
So let's say that for this project, I'm going to add one line of code says that console dot log and
I I'll say I'm done.
This is version one of this project.
So now I'm done creating my project.
On the vs code you can see that we have two notifications.
So what does it mean?
And this is what you call get.
This notification simply means that we have made changes to our project, but we are not keeping track
of it.
But let's move on.
When you finish, you better understand what this one means.
So now that we are done with the application, the next step is we need to go ahead and use this command.
So now we are done.
The next step is we want to push this particular project to GitHub.
So the next step is we need to stage these changes.
So here we go.
If you want to add the changes to our project, we are going to make use of Gates add and to check if
there are some changes being made on the application, we are going to use what is called git status.
The changes that we have made is that first we added the file code up to JS and secondly we added the
test on it.
That is why we have this two notification.
So next is let's check the changes we have made by making use of Gates titles.
Now, when I hit Enter, you can see we have couple of messages and you can see we have what is called
on track files, meaning that we are not keeping track of these files by default.
We got this one by ignore this one and let's focus on the file.
If you see being red, it simply means that we have made changes, but we are not tracking them.
That's why we see here as on track files.
So to be able to add this one, to be track, we are going to use this command called Gates.
Now, here we go.
Let me clear the terminal again and make use of Gates ad and space period when I hit Enter.
And you can see that I have plus two meaning that we are keeping track of two changes that we have made
to our application.
That's why we see plus two as soon as we initialize our project as gates, by default it has given us
a branch called Master.
And I explained to you as you move on.
So if I make use of Gates titles now, I want to see the status of my application and now everything
is green, meaning that I'm keeping track of these files.
The next step is that I want to commit.
When I say commit meaning, I'm ready to push this particular changes to GitHub to be hosted.
Right?
So to do that, we are going to use a command called Gates Commits.
So clear the terminal and make use of Gates commit dash am.
And the next one is to bring code and provide a message.
Let's say that my first.
Comments.
So what is the importance of this message?
It's really important because you'll be able to know in future the kind of changes you made to this
application when pushing to GitHub.
So always the name must be descriptive.
Let's say that you fix an error.
You can say that log in, error fixed.
So when I hit enter now you can see that two files changed and have created this mode.
So now it means that I'm ready to push this one to get help.
So how are you going to push this one to GitHub?
That is why we need what is called Git Hub.
So for this one, we are going to create a new repository or we can even create it from the terminal.
But let me show you the glory when using GitHub.
So now inside GitHub, click on Create Repository.
Or if you have some existing repository, click on your profile and you can see you have your repositories.
And for me I have no repository, so I'll click on New and then I'll provide the name of my repository.
So our code is one as gets projects, it can be anything.
Next is you can provide description to your projects and I'll call this one.
This is my first gate command.
And then we have this option called public and then private.
When we say public, it means that anyone on the internet can see this repository and you can choose
who can commit.
And for private you choose, who can see and commit.
So if make it public, it means that anybody can have access to your code.
But lucky for us, before before you can use private unless you are in a paid plan.
But GitHub has given to us for free.
So I advise you to choose private when you are developing a project for your client.
Okay.
So for this one, I'll make it as public.
And then down here we have what is called initialized this project.
Well, if we want to initialize this project, then click on otherwise click on Create because we have
already initialize our projects by making use of gets in it, we are going to use this option called
add with me file.
So if you click on this one is going to initialize this project as gate for you.
The next option is called Dot Git Inc.
No.
So it means that in the file or folder we put it inside ignore.
We are not going to see it inside gate most at times we put sensitive data inside.
Don't get ignored because you don't want to make it public.
For example, our private key or API key or mongodb connection string.
We need to put it inside git ignore and I will show you.
So by default they are giving us some template that we can work with.
We can search for node.
You can see that we have Node ignore file.
So let's select none for now and underline says you can select any of these ones based on your need.
So lastly, let's click on Create and now we have couple of options.
We have three options to push our project to GitHub.
The first option is create new repository on the command line.
So under create new, we are going to go through the steps as we did when we are initializing.
So we are going to use this one because we already have a project being worked, as did.
So we are going to use this option that says that or push an existing repository from the command line.
So the next step is we are going to copy the snippet.
So let's go to our terminal and then let me delete this one and let me clear it and let me paste that
and I'll hit enter.
The next step is that we need to change into this branch called Main, but because we initialize our
project from the command line by default it gives us master.
And according to GitHub, using master as a branch is no more the default and they use what is called
main.
So we need to change for master to main and I'll explain to you what is Branch now if I paste that and
hit enter and now we see that I have moved from master to Main.
So lastly, I need to push this project to GitHub.
So how are we going to do it?
Let me clear the terminal and to push it, we are going to make use of gates push or region.
And then the branch which is called men like that and hit enter.
Now let's see.
Our rights.
It has been successfully pushed to GitHub.
If I check the repository by refreshing it now have a look now and you can see that we have our project
being pushed to GitHub.
If I open the file and inside the file we can see that this is my code.
So now we have successfully push our project to GitHub.
But here comes the question.
Now let's say that after we finish pushing, we made changes to the code.
So let's bring back the projects and let's see.
Let's say that this time around I'm going to add index dots, a HTML file inside that.
Now.
As soon as I save it, have a look at my get extension.
Meaning I have one message.
Meaning that I have made changes to my code, but it's still not being tracked.
If I click on it, you can see that this is a changes I made, which is an index dot a html file.
Now to be able to re push, you are going through the same process by checking any changes we made.
That is the status.
And you can see that I have one file being on track and to be able to track it, you are going to use
gates dots after adding we need to commit that is gates commit dash m and then message saying that added
a HTML file and code and let's hit enter.
The next step is to push by making this of gates push or region main.
Make sure you tie the name of your branch as you see it is master type master.
So now our hit Enter.
Now let's have a look.
A successful if I refresh my project inside GitHub.
Now, if I go to the project, you can see that I have two files over here.
You can see we have additional tab.
This is the name of the person who added this file called a HTML file and the time and then the comments.
This one determines the versions of the project.
So if I click on that, I can go back and forth.
So if I want to see a code on the first commit the first version, which is this one meaning my first
comment and I added it 7 minutes ago.
So if we want to view a specific code based on the comment or version, we are going to click this icon.
Let's say that I want to have the code for my first version.
That's my first comment.
Then I'll click on that.
And now you can see that inside a file.
I have one file, meaning this is my first version of the application that I post to GitHub, and if
I click on Git Project now I can see all my files.
The next concept that I will show you is what we call the branch.
So let me show you in the next video.
So let me clear the termina.
So how can we push to get help again?
Well, here is a clue.