Configuring Git
In this video we'll configure Git. Now that you've Git installed, you'll want to customize its configuration.
First, we'll want to tell Git who you are. Git uses this for the author information when tracking changes.
While you can configure this per Git repository, it's most common to set it globally.
Let's set the user name by running:
git config --global user.name "JMac"
The configuration value is in quotes. In my case, I've set it to my name.
Next, we'll set the user email by running:
git config --global user.email "jmac@example.com"
And set the value to your email.
Some git commands open a text editor, so let's also configure the core editor. By default it's the same one used by your shell, which is normally something like vi
.
Now, while I might be comfortable using vi
, I definitely understand it's not for everyone.
So feel free to change your core editor by running:
git config --global core.editor ""
The value should be the command to open the editor. For example, to open Atom set it to "atom --wait"
.
If you use Sublime, you can set it to "subl -n -w"
.
Or, if you use another text editor, a quick Google search for the name of your editor and git core.editor should find the appropriate configuration value.
This is enough configuration for now. But before moving on to the next video, let's verify all of our changes are in place by running:
git config --list