Up and Running with Git Transcripts
Chapter: Tips and fixing mistakes
Lecture: Tip: Global Config Settings

Login or purchase this course to watch this video and the rest of the course contents.
0:00 There are a bunch of global settings that you can configure to control,
0:04 how Git works in general so that you don't have to keep specifying those sorts of
0:09 things, let's have a look at them.
0:11 So we have got some global settings for example,
0:13 sometimes especially when you could do a some kind of contribution,
0:17 like a push back to a remote repository,
0:20 they might require you specify your name and your email address so they can say that
0:24 this commit came from this person with this contact info.
0:28 And so instead of continuing to answer that question,
0:32 you can just run, git config globally modify it user.name and put your
0:39 name and user.email. Put whatever email address you want to use that way
0:44 get will never ask you again for your personal information.
0:48 You might have noticed when I was working,
0:50 there was no time where ever asked me for my password or anything like that.
0:55 So that has to do with all the credential helpers and there's different ways depending on
0:59 the platform you're on that, you probably should choose So on Mac.
1:02 Os you can say if I need to log in to git hub or do something
1:07 that requires my user name and password for GIT hub,
1:10 store that in the OS X keychain.
1:14 So that's a secure way to store your credentials locally tied to your user account.
1:19 You can also have git stored them in on a file locally,
1:23 you can have them and just cached in memory.
1:26 So maybe if you're on a server you want to log in maybe every time you
1:31 don't want to leave your have your user account up there have the password or whatever
1:36 account it is logged in. But while you're logged in you might want to keep
1:39 it. So you can't just say I'm gonna cache the credentials from the last time
1:43 I logged in until whatever this time out in seconds happens to be that you want
1:47 to choose. And then on windows,
1:50 you can choose manager and that will take care of something like the Os X key
1:54 chain as well. So you don't want to have to keep typing in your password
1:58 various places and whatnot. So here's a way to configure that globally and finally git
2:05 itself by for now is configured to use Master as the default branch.
2:10 But most repositories are moving to use main as the default main branch.
2:16 So you can configure that here.
2:18 We saw that message right at the beginning,
2:20 you can actually see all these commands,
2:22 which is why I have it over in my screen share style here you can see
2:25 them if you just look in your git ignore in your profile.
2:29 So for example, my user.name is Michael.
2:32 My user.email is Michael @talk python.fm.
2:36 Here's the diff tool for source tree and it's gonna open,
2:40 run this open diff and so on.
2:42 Again, merge tool for source tree,
2:45 here's my commit message template, which is I believe empty.
2:48 Our credential helper on mac Os is Os x Os 10 key chain,
2:54 which is, you know, the older name for Mac OS.
2:57 And here's when I ran that default branch command,
3:01 this is what happened. So you can see this and actually you can edit it
3:04 as well. It's just basically an I and II file,
3:07 sort of something like that anyway,
3:10 you can edit the file and this is where your settings are stored and just your
3:14 user profile .git config. And when you run those global commands,
3:19 you know, you don't ever have to specify your name again.