What is up everybody this is Jason with Def soapstar com and in this video we're going to cover the
good basics.
All right.
So let's get to it.
The first thing that I want you to do is go ahead and open up your terminal or your a command prompt
and I'm going to zoom up on this so you can see what we're doing here.
And we're going to be working with get here now.
Max Apple products the Mac books and everything like that.
They come with a Get already installed on the hardware.
Now if you're a Windows user get may or may not come installed.
So let me show you where to go to get get installed if you need to.
Some opening up a browser here.
Let me zoom up just a little bit.
And what I'm going to do is I'm just going to do a simple Google search for an install it.
All right.
And then I don't know we can come down to the second one.
The first one might work I don't know.
Just come down to one of these and it says getting started installing get.
All right so we can install from the source.
And these are the combat the commands that you throw into your terminal here and then down here it shows
you how to install this for Linux how to install it on Mac which again Mac already comes with it pre-installed.
And then down here at the bottom it shows you how to install this for Windows.
So this is a very very simple stuff.
If you don't have get installed Do a google search install get get it installed.
Pozza video come back I'm sure you're done.
Let's get started.
Cool.
All right so what we're going to do here is we're on and we're we're in our terminal and what we want
to do is create a project and we want to start tracking it with get.
All right.
It is very useful it's very powerful.
It's a version control for projects and it allows us to track like time stamp different states of our
project.
So let's go ahead and change our directory onto the desktop and we're going to create a folder here
so make Durr.
And I'm going to call this get randiness are right and then dive into your folder here.
And what we're going to do is we're going to create a file our first file on it so we can use touch
and it's read me dot M.D which is a markdown file.
OK.
Go ahead and press enter.
We list this out you can see that we've got a file in here.
Now what we want to do is now that we've created this file Let's go ahead and just add some content
to some text so we're going to use vim and we're going to do.
Read me dot M.D.
And this is going to take us into the read me file to take change to make changes.
We're going to press I for insert and then let's just go and create a title my first title.
I don't know something simple and go ahead and press it shift CONAN lowercase X and there you have it.
That's how you get out of them.
I hate vim.
I used to have to do a forced quit on the terminal when I was in them because I was stuck and I had
no idea how to get out it was worst.
But anyways good thing this lesson is on get.
All right so now if we do get status we just created a file and made a change in it.
Now let's check with get status to see if there's been any changes that have happened in our project
and this is fatal.
Not a good repository.
Now the reason it's throwing this error is because we have to initialize.
Get on this folder.
We have to tell good to start tracking this project.
All right.
So to do that type get it right and you always want to make sure that you're at the root level of your
project.
And what this means is any changes that happen in subdirectories or any files beneath this in the hierarchy
of things it's going to track all of that good.
Only tracks from the parent level and down.
All right.
So we're going to do get a net awesome initialize empty good repository.
So that's great news.
So now it is tracking a project.
So if we did get status you can see that it says that we're on Branch master.
It's our new initial commit and then you'll see that the readonly file that we created down here is
red.
What does this mean.
It means that this is an untracked file we have never told get to track this file.
All right.
We initiated tracking on her folder but we haven't specifically told get to actually track anything
in here.
So let's go ahead and do this now just start tracking files.
We have to add it.
All right we have to add it to get and say hey we're adding this file to you.
Go ahead and police track it.
So we're going to do get at it and then we can simply type out the name of our file.
Cool.
So we've added this to get it's now tracking it.
So if we do get status now you can see that it has now been changed to N-Track.
Now it's saying that it's being tracked here and that we have a new file that we've created called Read
me.
All right.
So let's go ahead and make our first comment.
It says changes to be committed.
We've got it right here.
All right.
So good commit dash em for message and then we'll our first message here first.
Come in and hit enter.
Perfect.
So it says that we're on the master branch.
It says that there has been one file change and one insertion.
OK.
Because we've now added this file to get to be tracked.
So that's great.
All right.
Now let's go ahead and create a another change into our reading file here.
And so we did them dash read me again.
Got to capitalize this if I want the auto correct to work and we're going to come inside here.
We're going to hit for insert and then come to the end.
I'm going to make another change.
And let's just make another title here.
OK.
Second title.
Awesome.
Go ahead and press X shift Colan x.
All right so now if we did a guest status you can see that the file has been modified now so before
it was telling us that we had an untracked file and it says Dude you've created a new file here.
All right.
Well now we've actually modified that file.
And good is going to tell us that.
So when we have projects and if we are creating new files or modify the existing files when we do get
status to see kind of what's been happening in our project what we've been working on good is going
to spit out everything that we've been doing whether we've modified files or created new files or i'm
And so now that we've done the status now we can go ahead and add this again.
So we want to say get at it read me file.
And now we can go ahead and I'm just going to get status here.
So now it's saying that it's been modified.
Right.
And we've added it to.
So now it's being tracked again.
So get commit dash.
And so we can add a message and then added a second title cool.
So one file change and two insertions and it says two insertions because we created a blank line in
our Rimi file and then underneath that we created the title the title.
So cool stuff to know.
Now the next thing I want to move onto is tracking different versions of every get commit that we've
done.
So for example we've made two committees.
So if we do a good command we're sorry I get log.
You can see that we've made two commits here it time stamps it for us.
The thing is set in stone it's going to be added to world history.
This is never going to go away.
We'll never lose it.
Now I want to show you something really important here say that your your boss comes to you and he's
like dude like I don't know why you created that second file or maybe that you've got a project was
like a thousand lines of code and you change something and he's like bro you've messed everything up
like this is terrible we need to go back to the previous version.
Well how do we do that.
How do we go back to the version before we added that second title.
So if we wanted to go to the first version and this is right it right here you can see where is it.
So here it says we added the second title right here was our first commit.
All right.
So does it chronologically does it from the most recent on top to the oldest on the bottom.
So what we can do is do a good check out and we actually just need the first seven characters of the
commit that we're checking out.
So one two three four five six seven and then go ahead and copy them at a space and we'll paste that.
So if I hit Enter now it says get check out the new branch.
It says you are in a detached head state.
You can look around make experimental changes and commit them and you can discard any comments if you
make this state without impacting any branches by performing another check out.
Well what does this mean.
If we do a get branch All right that says that we're at a detached head.
So what I really want to do is create a new branch for everything that I've been working on and will
simply do this by check out dash B and then will name the branch I'm just going to call this my branch
and what it's going to do is it's going to take all the changes that we've been making because right
now it's hard to detect a detached head of M..
But we just want to pull this into our own branch so all the changes that we've been making we're now
going to check out and create our new branch and put those changes into it.
All right so cool it says switch to a new branch which is the branch I created called my branch.
Now remember we just checked out a previous commit here.
So to see the previous commit that we made let's simply do the again and let's go ahead and check out
the read me and see what's in there.
So check that out.
It says It's my first title.
There's only one title in here right.
Go ahead and exit out of this and I'm just going to hit shift Colan x.
We're out of it.
Let's do the get log again and then let's go to the second commit that we did.
Oh actually we were in a detached head.
So it only has this initial stuff.
So check this out.
Let's do a let's create a file.
Touch main dot J us k.
Now if we do our guest status remember we have an untracked file.
We've never told get to track this before.
So why don't we go ahead and tell it to track it.
So get at Main dot J us OK we'll do another get status see what's happening here.
So now it's being tracked and says hey you've actually got this new file that's never been tracked before.
So what's committed they
don't want caps on added file.
And then we go in there one file changed your insertions zero deletions.
Cool.
So just status.
And it says nothing to commit the working tree is clean.
So this is great news.
So what I'm going to do here is say that your boss comes to you and says bro you've created this.
This javascript file.
It doesn't make any sense.
We don't need it.
You wasted a ton of time.
It's broken the current code.
Please we need to go back to the previous version.
All right so again let's do that get log and you can see that we have two.
Commits that we've done here on this branch that we created first commit and then we just added this
javascript file.
So this added file comment here.
This one here that we just did is the one that broke our project.
We need to go back to the previous version where we didn't have this file.
So again all we need to do is do get it check out.
And then the first seven characters of our commit 1 2 3 4 5 6 7 go ahead and copy that and then we'll
go ahead and paste this.
Now it says the head is now at your first commit.
All right.
So check this out.
We're in our project we had a read me file and a javascript file or I can actually pull this open for
us so we can kind of see what's going on here.
So let's check this out so you can see that we've only got the readonly file in here.
If I list this out we've only got the read me file but if I go ahead and I do the get log again and
say we want the where where's that other one with the file that we had at Cisco right here.
The added file 1 2 3 4 5 6 7.
So we want to check out this commit now.
Let's go ahead and I have to do the get checked and get check out this branch.
So now it says the head is now at the added file.
We'll check that out.
There is our main J.S. so very important stuff we've covered today.
We have learned how to initialize get We've learned how to add files to get and to track those.
And then also how to do checkouts and things like that for different branches.
Now the last thing that I want to cover is how to add multiple files to your commit right before we've
been adding individual files at a time.
But heck what if we like added 10 files and changed a ton of things and other files.
So now that we've got this version checked out here with the added file Let's do this let's do touch.
We'll do an awesome dot.
J.S. will do an index died aged.
And we'll do a style that CSSA will add some files here and then lets them into the read me and then
we're going to add an insertion here and we'll say so many important files added.
Obviously this wouldn't be added to a read me.
I will just use this for now.
So hit X shift colon X..
Perfect So now we're out of that.
So check this out.
If we do get status on this we can see that we've modified the read me file and that we've got all these
untracked files here.
Well instead of doing the add in every single file why don't we just add everything as a group.
Say I want to add anything that's new.
And anything that's modified to be tracked with good so we can do that.
Good and we're good at Dash capital A.
And this is this is more traditional This is what you're going to see and you're just going to grab
everything and then add it.
Now do be warned that you maybe you were working on a feature or maybe in a folder that you don't want
to be tracked yet with yet because it's kind of experimental you'd want to use like to get ADD or a
different method not to get capital A to grab everything because you'd want to exclude that folder.
So good ad dash.
And then we can do a guest status here and now you can see that these are now being tracked.
We've got a modified and three new files.
All right and then we can go ahead and commit this good commit dash am.
So much awesomeness.
Ok cool.
So it says for files change two insertions.
So it's all those and it's it's committed it for us.
Now we haven't covered about pushing this stuff yet.
We're going to cover that in some later lessons.
But I know this was a lot to take in.
We watched the video a couple of times if you need to get can be very confusing in the beginning.
But watch this video if you need to brush up on it kind of experiment creating some of your own files
and tracking them and things like that so that's a wrap for this lesson.
Let's move on.