Install git on OS X
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 from http://git-scm.com/download
This may be the easiest way to get git installed on a Mac.
Alternate install 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 git setup!!!!
Git needs to know 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 your ssh keys
You probably have this done already, but if not, follow these steps to setup your ssh keys.
1. Check for 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.
2. Generate a new SSH key
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 "email@example.com" -f ~/.ssh/id_rsa
3. Copy your id_rsa.pub key to github
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== firstname.lastname@example.org
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.