In the last movie, we initialized Git with our first_git_project.
I want us to look at what that did and also understand where Git stores the
files that it uses to do version control on our project.
You can see that I have got the first_git_project directory open here in the
Finder, and you can see that it's empty, actually it appears to be empty,
it's not in fact empty.
If we come to the command line, I can use the UNIX ls command to list what's
in that directory, you can see that that's empty, on Windows that would be the dir command.
I can pass in a special option here which is -la, and that will show me the
hidden dot files as well, and that's any file that has a dot in front of it is
normally going to be hidden.
So .git is a directory that is created by that initialize command.
And this directory is a directory where Git stores all of its tracking information.
Now that's all of its tracking information, it doesn't matter how deep down in
other folders that we've got files going on, they are always going to be stored
at the top level of our project inside this .git directory.
You can think of it as Git's workspace where Git does everything that it's
going to do, and if we wanted to remove Git and remove version control from our
project, well, then it would just be a simple matter of removing this .git directory.
If we remove that, then suddenly Git is no longer tracking our project.
Obviously, we don't want to do that at this point.
Let's take a look at what's inside that directory, ls -la .git, and we can see a
list of the files and folders that Git uses while it's doing its tracking.
Now again this is Git's workspace, you don't want to come in here and start
messing around and changing things, leave it alone, let Git manage these files
and let it put things where they need to be.
The only exception to that would be the config file, that's the only thing
that you would really ever come in here and either take a look at or even possibly edit.
This is for our project level configuration.
Now we have an interface through Git that we saw in the Configuration chapter
where we don't have to come in here and edit it directly, you can just use git
commands to set the different values that you need.
But if you did ever need to, that's where this file is located.
Everything else, you want to leave alone.
Now again, I want to just emphasize the point that everything that Git does
is going to be stored in this single top-level directory, that's very
different from svn.
If you've worked with svn before, svn puts little tracking files in every single
directory down the line.
So if you wanted to remove svn, you have to go through and actually pull
out those .svn files from every single directory so that it will stop tracking those.
Git doesn't do that, Git puts them all right here in one place at the top level.
Now that we understand where Git maintains information about our project, let's
go ahead and create our first commit so that git can start tracking things
inside of our project.