Bash script to help new users set up their git installation
Switch branches/tags
Nothing to show
Pull request Compare This branch is even with up1:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a simple bash script to aid users with the git and GitHub setup process. It will do a few things:

  • Set values in your global git config:
    • (used by GitHub to match commits to their author)
    • github.user & github.token (used by third-party apps that interact with GitHub and Gist)
  • Help you create a new ssh key if one is not found
  • Upload your public ssh key to your GitHub account
  • Ensure ssh-agent loads for msysgit users

This script has been tested on OSX Snow Leopard and Msysgit. You must have git installed before you run this script.

Downloading and running the script

$ git clone git://
$ setup/
GitHub username not found, please enter: tekkub
GitHub token not found in global git config
Please enter GitHub password for tekkub (this will not be saved):
Fetching API token
Saving GitHub token to global git config
Enter git committer name (return to use 'tekkub'):
Enter git committer email (return to use ''):
No id_rsa key found, generate one? (y/n) y

*     GitHub highly recommends you use a strong passphrase on your key     *
* Visit for more info *

Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/tekkub/.ssh/id_rsa.
Your public key has been saved in /Users/tekkub/.ssh/
The key fingerprint is:
Upload id_rsa key to your github account? (y/n) y

Msysgit (windows) users will be presented with an extra option, since ssh-agent doesn’t load by default in msysgit:

You appear to be running Msysgit, would you like to use the ssh-agent loader?
This script will load ssh-agent to save your passphrase so that you don't need
to re-enter the passphrase every time you use your ssh key.
For more info visit

Install script to your .bashrc file? (y/n) y
Script installed, you will need to re-open git bash to load your key.
[Tekkub@KAKU: ~ master]$