- [Instructor] Hi, I'm Cameron Mackenzie
and I wrote a little article on where
system global and local Windows Git
config files are saved.
I actually just wanted to take you through that process.
I've actually got a Git repository initialized here
and as anybody knows,
if you go into Git
and you try and commit some changes,
and you haven't configured
your username and email address,
all of a sudden you get this message that says,
"Hey, we don't know your email address,
and we don't know your name".
And you have to go into this process of saying
Git config global.
User.email
and you have to do user .name, as well.
So that ends up
generating a couple of questions
especially from new users,
I should be able to do my commit now.
Yeah, everything worked.
But that generally triggers
a few questions from new users
because they start to think,
"Okay, well, if you've specified the global scope,
what other scopes are there".
And there's actually two others,
there is a system scope,
that you can specify here,
and there's also a local scope.
So right now, I've actually configured
a different name
in each of the three scopes.
I've got local McKenzie,
I've got system Mckenzie
and I've got Cameron McKenzie.
And so where is all of this information
being saved is a question that gets triggered.
So we've got three scopes
system, local and global,
and wouldn't you know,
we've actually got three different configuration files.
If you actually want to see
where these configuration files are,
you can actually just go in,
and instead of specifying
username or email address,
you can just say edit,
and this will open up an editor.
So here I ask it to edit the local config file,
and it opens up a local config file
I don't know if you can see that, but it says,
"Basic Git commands Git config".
And so this file
where it says, "Local McKenzie",
is held in this directory here,
inside the Git directory of my local repository.
So now I have to close that editor,
and I'm gonna ask to see where the global config is,
and here we see Cameron McKenzie
which was the first one I set up.
And you noticed that saved in users,
Maven user Git config,
and so Maven users,
the users that I've logged in with,
as you can see the files is named .Git config.
So that's kind of interesting,
it actually doesn't have a file name just an extension,
and that's up here
in the user directory.
I now close that window.
And then the last one I'll look at is system.
Then you probably won't be surprised
to find out that
a system level configuration file
is actually stored right under the installation.
So I'm not sure if you can see that there,
but Git mingw32,
might not be 32 on a 64 bit machine,
etc Git config,
no extension
no dot in front of it,
and here you see where it's specified
user is system McKenzie.
By the way, you also notice that right here is
where it's been configured for notepad to come up.
When I want to edit, commits,
or even edit the config file,
that's where you go
if you actually want to change
what the core editor for your Git installation is.
So anyways, that's it,
that kind of goes over, there is
my local Git,
there is my global Git,
and there finally is the configuration
at the system level.
So if you want to find out more,
head over to the server side.com,
I do have a couple of articles on this topic,
and feel free to follow me on twitter
at Cameron MCNZ.