12 Days of Gitmas: Setting up Git
Tags: beginners, git, github, tutorial
Published: 2019-12-14 18:00:47

*On the second day of Gitmas, my mentee asked of me... 
__how do I get Git set up?__
[and could you explain Git, pretty please?](https://dev.to/sushicodes/12-days-of-Gitmas-intro-to-Git-4l26)*

Welcome to the 12 Days of Gitmas!

On Day 1, I gave you a super simple intro to what Git is.  Today's Day 2, where I'll be helping you install Git on your computer.

By default, your computer doesn't come with Git installed.  Unfortunate, I know.

The simplest way to install Git is to go to the [Git website](https://Git-scm.com/) and click the Download button, and then follow the provided instructions.  Just go ahead with the default settings.

![Screenshot of the Git website with an arrow pointing to the download button](https://live.staticflickr.com/65535/49216090662_67f1a85a52_b.jpg "This is what the Git website currently looks like, as of December 2019")

Once you have Git installed, there are a couple more things you need to do to get Git running.

One of the benefits of using Git is that you can work with a lot of other people, and track everyone's changes.  In order to do this, Git needs to be able to match the changes made to the project with the person who made those changes.  In order to do that, you'll need to set a name and email that you'll "sign" your changes with.

First, open your terminal.  If you're on a Mac, you can use the Terminal app that comes built-in, or download [iTerm2](https://iterm2.com/) (which is what I use).  

If you're on Windows, Git Bash will be installed when you install Git.  Git Bash is a terminal emulator that allows you to access Git on Windows.

Once your terminal is open, type 
`git config --global user.email "YOUR EMAIL HERE"`
but replace `YOUR EMAIL HERE` with your email address (keep the quotes), then hit enter.  If you already have an account on GitHub or BitBucket, you should use that email (and if you don't know what those are, that's fine!  We'll be discussing those in an upcoming post.)

When you hit enter, nothing should happen.  That's as it should be!

Next, type 
`git config --global user.name "YOUR NAME HERE"`
this time replacing `YOUR NAME HERE` with your name.  Often, if you're working on a project with an employer or client, you should put your full name there.  However, if you'd prefer to keep your identity private, you can write whatever you'd like there.  Just keep in mind that this can be seen by others, so you may want to keep it at least somewhat professional.

Again, nothing will happen when you hit enter.  However, there is a way to see if your changes worked:
`git config --list --show-origin`

This will show you where your `.gitconfig` file is located, as well as what the current settings are that you just set.  If you know how, you can also go directly into your `.gitconfig` file and edit your settings there, too.

(If you're on mac and you get stuck here, type `q` to get out of this view.)

![Screenshot of what I see with the git config --list command](https://live.staticflickr.com/65535/49223782567_2f0563c083_o.png "My email setting is there too, but I didn't want to just hand that out to everyone!")

Now you are set up to use git locally... which is what we'll be trying out in the next post!

Any questions about setting up Git?  Did you run into any issues, or is something unclear?  Let me know in the comments!

If you have any questions about Git or requests for other topics you'd like to see me blog about, please leave a comment!  And if you're enjoying this series, consider supporting me on [Patreon](https://www.patreon.com/sushiday), following me on [Twitter](https://twitter.com/sushiday) or checking out my [Twitch](https://www.twitch.tv/sushicodes) [streams](https://www.twitch.tv/sushiday)!