Resource mentioned in this lesson: Git Installation Instructions
Setting Up Git
00:00 First things first, you’ll want to set up Git, the command-line utility that you’re going to use to version control your code. In order to set up Git, you need to do two things.
00:11 You need to install it on your machine, and then you need to configure it. To install it, open the Git documentation, the URL can be found on the screen, and you should find the page with the installation instructions.
00:24 These installation instructions will depend on your operating system, so make sure you pick the correct operating system and then follow the installation instructions that you find there.
00:35
Once you’ve followed the instructions, open your terminal and double-check that the installation was successful. For that, run the command git --version, and this should tell you the version of Git that you have installed.
00:51 If you suspect you already have Git installed, you can actually run this straight away and see if you get output that is vaguely similar to the one you see on the screen, saying git version 2.something.
01:03 Once you’ve installed Git successfully and once you’re able to see the version you have installed, which will be 2.something at least, you want to configure Git.
01:13 And this means telling Git a little bit about who you are, your name and your email address, so that that information can be added to your code repositories.
01:22
To do that, you’re going to use the git config subcommand, and then because you want to set up your global identity, you want to configure Git to apply these settings across all of your repos, you’re going to use the option --global.
01:37
So you type git config --global and then user.name. And in front of that, you’re going to type your name. And if you have multiple names, you can use quotes to include the whole thing.
01:49
So for me, that would be Rodrigo Girão Serrão. And then you press Enter. And if it succeeds, you should see nothing. In fact, to double-check that you got the correct name, you can then try running the command git config user.name without anything in front so that it reads the name.
02:11
And you can double-check that you typed the correct name. And similarly for your email, type git config --global user.email, and then you’re going to type your email.
02:21
And then to double-check that you typed the correct email, you can type git config user.email and then press Enter to read your email address.
02:33 And once you’re happy with these two values, you can move on to the next lesson where we’re going to create your first Git repository.
Become a Member to join the conversation.