Forget the terminal. Download our native app instead.

Download GitHub for Mac

If you've found yourself on this page, we're assuming you're brand new to Git and GitHub. This guide will walk you through the basics and explain a little bit about how everything works along the way.

Download and Install Git

At the heart of GitHub is an open source version control system (VCS) called Git*. Created by the same team that created Linux, Git is responsible for everything GitHub related that happens locally on your computer.

*If you don't already know what Git is, take a crash course.

Download and install the latest version of Git.

Tip: Git won't add an icon to your dock, it's not that sort of application.


Now that you have Git installed, it's time to configure your settings. To do this you need to open the Terminal.

Username

First you need to tell git your name, so that it can properly label the commits you make.

git config --global user.name "Your Name Here"
# Sets the default name for git to use when you commit
Email

Git saves your email address into the commits you make. We use the email address to associate your commits with your GitHub account.

git config --global user.email "your_email@example.com"
# Sets the default email for git to use when you commit

Your email address for Git should be the same one associated with your GitHub account. If it is not, see this guide for help adding additional emails to your GitHub account. If you want to keep your email address hidden, this guide may be useful to you.

Password caching

The last option we need to set will tell git that you don't want to type your username and password every time you talk to a remote server.

Tip: You need git 1.7.10 or newer to use the credential helper

To use this option, you need to install the osxkeychain credential helper and tell git to use it.

There is a chance you already have the osxkeychain helper, depending on if you installed git using homebrew or if you have the latest git version.

You can verify this by trying to run it:

git credential-osxkeychain
# Test for the cred helper
# Usage: git credential-osxkeychain <get|store|erase>

If you do not have the helper, you can download it with curl:

git credential-osxkeychain
# Test for the cred helper
# git: 'credential-osxkeychain' is not a git command. See 'git --help'.

curl -s -O \
  http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain
# Download the helper

chmod u+x git-credential-osxkeychain
# Fix the permissions on the file so it can be run

Now you need to install the helper into the same directory where Git itself is installed.

sudo mv git-credential-osxkeychain \
  "$(dirname $(which git))/git-credential-osxkeychain"
# Move the helper to the path where git is installed
# Password: [enter your password]

To tell git to use osxkeychain, simply set the global git config:

git config --global credential.helper osxkeychain
# Set git to use the osxkeychain credential helper

The next time you clone an HTTPS URL that requires a password you will be prompted for your username and password, and to grant access to the OSX keychain. After you've done this, the username and password are stored in your keychain and you won't be required to type them in to git again.

Tip: The credential helper only works when you clone an HTTPS repository URL. If you use the SSH repository URL instead, SSH keys are used for authentication. This guide offers help generating and using an SSH key pair.

Celebrate

Congratulations, you now have Git and GitHub all set up! What do you want to do next?