Skip to main content

Installing and Setting Up the Git Software Tool on OS X

Learn how to install the Git software tool on OS X for use with the Eagle system.

You can most easily install git on your Apple Macintosh using a binary installer, or via MacPorts or Fink.

Binary Installer for OS X - Easiest!

You can download the latest version of git.

This may be the easiest way to get git installed on a Mac.

Installation Methods

Install git with MacPorts:

port install git-core

Install git with fink:

fink install git git-svn

Install with brew:

brew install git

Basic Set Up

Git needs your username and an email address at a minimum. Substitute your name and email address:

$ git config --global user.name "YOUR NAME"
$ git config --global user.email "YOUR.EMAIL@nrel.gov"

Set Up Secure Shell Keys

You probably have this done already, but if not, follow these steps to setup your secure shell (SSH) keys.

Have an existing key pair? You can skip to Step 4.

First, we need to check for existing SSH keys on your computer:

$ cd ~/.ssh

...Checks to see if there is a directory named ".ssh" in your user directory. If it says "No such file or directory" skip to skip step 3. Otherwise, continue.

 If you don't have a ~/.ssh/id_rsa.pub file, you'll want to create one. To generate a new SSH key, enter the code below. We want the default settings. So when asked to enter a file in which to save the key, just press enter. DON'T DO THIS IF YOU ALREADY HAVE A KEY!
$ ssh-keygen -t rsa -N '' -C "your.email@nrel.gov" -f ~/.ssh/id_rsa

If you cat the id_rsa.pub file, copy the output. You'll paste that into the git service later:

$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAB3NzaC1yc2EAAABIwAAQEApIS9754yqnP3CR73paKFCUSE+BUfQREVgRMz65b2qFKIucfIolh4wL9KpzllGJ8NJXW6pyOVal5MrY6DOhJkH9+10z0BNa1JdEmnOyhuwxqOO6cr2SuRHonmaR4UhIU1ieYRv9HvhFshqmc/3TqqtTqBnHuybkGVlVgsaz78dZEO1iV2vxDTEUwtzeJUYuHHtO+QOhIC3FyjNJ+uIcpUkgV82idCSXZS/9WCrJA2Z+HAKMr8LOrN2IIhamq1bO7vWOu1kEbs3YEzajDCcIdRtGoCA83s7JtL0Cw8/IOJdxsuiIJUrFqDtU8f/s02vyMEARzPnwzqAQAyiNV+lyw== you.last@nrel.gov

Next Steps — Using Scientific Computing's Git Repository

Now you have all the basic configuration for using git with a remote repository ready. Your next steps will be to get access to a git repository, clone the repo, and learn how to add content and commit changes to your repo.