In this video you're going to get a high level overview of how we'll be using get to and version control
to track changes to our application over time.
For the moment we're going to stick with exploring this via a visualization.
In the next lecture we'll actually run commands from the command line to integrate and get into our
projects.
So with get end version control typically comes a lot of confusion.
That's because there are a lot of new terms we're going to need to define and concepts we're going to
need to explore once we're familiar with the basics of how get is going to track our files and manage
our project.
It'll be a lot easier to run the commands in the next video and actually understand what's going on.
For this example let's imagine that we have a new project.
So I create an empty directory on my machine and we'll say that I'm building a node application for
serving up a portfolio Web site.
Now I decide that I want to use version control with get and the first thing I would need to do is run
a command to initialize get in that new project folder.
We'll talk about what the command is in the next video and you'll actually run it.
But for the moment it's enough to know that you have to start up get in every project where you want
to use it.
Now once get is initialized you can start to add files into your project and that is where these four
columns are going to come into place.
We have unattractive files on staged changes staged changes.
And finally we have commits.
Let's get started with the first column which is unattractive files.
So by default get doesn't track files you add to your application you're gonna have to run commands
telling get that you want to track specific files.
So if we were to add a couple new files to our project they would show up as entourage files.
I'll add source forward slash app dot J S A NOTE J.S. script then down below I'll add read me dot M.D.
a markdown file which contains the documentation for our project.
So by default all new files you add to your project will show up under contract files.
Now at this point we can start the process of getting them into commits when something has been committed
to get get is indeed tracking it.
And that's a two step process.
The first thing we do is we move everything we want to commit over to staged changes.
So this is where we put things we want to save.
And then when we save all of these things get bundled up into a commit.
Let's go ahead and see what that really looks like.
So we would run a get ad command which we'll use in the next video.
This is going to allow us to take one or more files from Entourage files and bring it over to staged
changes.
In this case I'll just bring one file over leaving the other an entourage files I could bring both over
if I wanted to or I could just bring over the one now from here.
As I mentioned Stage Two changes contains the things that are going to be included in the next commit
the next save point if you will.
The next step in the process would be to actually create a commit using the commit command which we'll
also use in the next video when we use the commit command.
It's gonna take all of the files in staged changes in this case just the one it is going to bundle them
up into a single commit and that is going to show up over here.
Now each commit has a unique identifier.
In reality it's a bit longer than this but for this I've picked a random set of characters one a B for
nine.
So after running those two commands get add and get commit.
We would have a set up that looks a little bit like this.
We have a single commit tracking some changes to our project and we have a single entourage file read
me dot M.D..
Now let's say we're ready to continue on with the project.
We add a new script into the project and as we know that's gonna show up under contract files.
So I add geo coded J.S. in the source you tells directory and that's sitting right here in Entourage
files alongside of Read Me dot M.D..
Now we've included this new script in the project and it's time to use it.
So we make some changes to app J S requiring this file and actually calling the function it provides.
When we make a change to a file that is already tracking that comes in under UN staged changes.
Now what categorizes a file that get his tracking it is a file that has been included in a previous
comment in this case.
Source forward slash app Doc J S was the only file included in the only previous comment so this would
be the only thing currently under onstage changes.
So now at this point we're going to make another commit.
Remember that's a two step process.
We bring the things we want to commit over to stage changes.
Then we make the commit taking all of this bundling it up in a new commit.
So right here I'm gonna use the ad command once again to bring two things over to the staging area.
I'm gonna bring over source forward slash app not J.S. and I'll bring over geo code and J.S. from the
source utilize directory.
Now I could also choose to bring over read me M.D. but on leaving that there to let you know you don't
have to have get track everything.
So once the ad command is done our setup is going to look a little bit like this and then we can use
the comet command to take all of this and create a brand new commit.
So right here I use the comet command.
It bundles up everything in staged changes and it puts them in a new commit.
Now at this point in the process we have two comets inside of our setup.
We can revert back to those commits to get the application at that point in time.
So at this point in time with the first comet we had a single file app.
J.S. in its old state with the second comet.
We now have two files we have geo code that J.S. and we have at J.S. in its updated state as we continue
to add new features to our project.
We can create new comets and those will show up over here alongside of our two initial ones.
And that's where we're going to stop for this video.
The goal of this video wasn't to get us to the point where we've mastered get the goal is to just get
us familiar with a couple of basic concepts related to get things like Entourage files which are new
files added to the project onstage changes which are changes to files that get is already tracking stage
changes which are things that are about to be committed and commits which are the various save points
as we've built out and changed the files in our application in the next video we're going to put all
of this into practice and actually run get commands from our project.
I'm excited to get to it.
So let's jump right in to the next one.