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

Talk Python's Mastodon Michael Kennedy's Mastodon