How to install Git SCM

Kent C. Dodds
InstructorKent C. Dodds
Share this video with your friends

Social Share Links

Send Tweet
Published 8 years ago
Updated 5 years ago

Let’s install the Git Source Control Management software so we can interact with repositories hosted on GitHub.

[00:00] Before we can start contributing to a project on GitHub, we need to set up Git on our local machine so that we can commit code and push it up to a repository. First, let's check if you have Git installed. Go to your terminal application and type git --version. If you get a version printed out here, then you are good to go. You have Git installed.

[00:19] If you don't, then you're going to need to install Git. You can do this by going to git-scm.org. Here, you can download and install Git. If you're on a Windows machine, make sure you install Git with the BASH, because that's what you're going to be using to interact with Git. Once you have Git installed, you're going to want to configure it.

[00:37] Go to your terminal and type, git --version to make sure that you have Git installed, and then we're going to want to configure it so that any time we make a commit, Git knows who to associate that commit with. We'll set this globally on this machine because I'm the only one who commits code on this machine. I'll say git config --global user.name and then your name. I'll say, Kent C. Dodds.

[01:01] We'll do the same with git config --global user.email and then put our email, I'll say kent@doddsfamily.us.

[01:11] Another thing that's good to set up when you're configuring Git is what's called a global .gitignore file. While coding, there are some files that you want to avoid adding to the repository because they're specific to your computer or they're generated files.

[01:25] There's actually a GitHub project that we can use to get a good starter on our global .gitignore. If you go to github.com/github/gitignore, then there are a whole bunch of examples of .gitignores that you can use. By typing the T shortcut, you can search through all the files in the project.

[01:45] We're going to go ahead and look for OS X, because that's the system that I'm running on. Here we can copy this into our global .gitignore file. We place that in our .gitignore file that is placed at our home directory. On my Mac, I'll CD into the home directory which is incidentally where I am now. You can use Vim or your favorite editor to open up the .gitignore_global file.

[02:10] I already have mine in here. This is where you would put what you want to have for your global .gitignore.

Oalbacha Albacha
Oalbacha Albacha
~ 7 years ago

I can't find the same file OSX on github as explained and shown in the video. The only osx file I see is Global/SublimeText.gitignore. Is that the same?

Oalbacha Albacha
Oalbacha Albacha
~ 7 years ago

I can't find the same file OSX on github as explained and shown in the video. The only osx file I see is Global/SublimeText.gitignore. Is that the same?

I also found MacOS: gitignore/Global/macOS.gitignore. Please advise. Thank you,

Oalbacha Albacha
Oalbacha Albacha
~ 7 years ago

What about gitignore for Windows? Can you assist please?

Markdown supported.
Become a member to join the discussionEnroll Today