Skip to content
This repository has been archived by the owner on Jun 25, 2018. It is now read-only.

Setting Up Git

Alex LaFroscia edited this page Sep 25, 2015 · 3 revisions

Setting Up Git

Git has a few things that you need to configure in order to use it without a hitch

Contact Information

First off, you need to set the name and email address to sign your commits with, so that other people know who to get in touch with regarding questions with your code

$ git config --global user.name "{name}"
$ git config --global user.email {email}

Where {name} is your name and {email} is your email address, of course. If I were to run the commands above, they would look like this:

$ git config --global user.name "Alex LaFroscia"
$ git config --global user.email [email protected]

Other Git Configuration

Tell Git to do a simple push instead of a matching push

This means that every time you run git push only the current branch is pushed, not every branch.

$ git config --global push.default simple

Authenticating with Github

You also have to do a one-time setup between your computer and Github, so Github can make sure that it's you when you're trying to interact with your git repositories. The guide that Github provides for this is excellent, so instead of re-writing it myself, I will just point you to it.

Github's guide to adding SSH keys to Github

Windows Users: You might see something about a command called pbcopy that will not work on Windows. If you see this, it's just asking you to copy the contents of that file to the clipboard. You can open that file in a text editor and copy the contents that way instead.

You can also set up more basic authentication over HTTPS, but I highly recommend SSH instead because using SSH authentication makes enabling 2-factor authentication on your Github account a lot easier.