Connecting to GitHub Enterprise (command-line)

Category

Connecting to GitHub Enterprise at Georgia Tech, unlike Github.com, requires a few additional steps because GitHub Enterprise is not publicly accessible.

Please note that it is much easier to connect to GitHub Enterprise via GitHub Desktop, which natively supports enterprise installs like GitHub Enterprise at Georgia Tech.

To facilitate access to a repository in GitHub Enterprise at Georgia Tech, follow the directions below.

Setup

Derived from metroplus documentation.

  1. Generate a SSH key:
    ssh-keygen -f ~/.ssh/filename-goes-here -b 4096
    
  2. Copy SSH key files onto your server of choice into ~/.ssh/, making sure that your private key is chmod to 0400.
  3. Add the SSH key to your GitHub Enterprise at Georgia Tech account.
  4. Establish SSH fingerprint for GitHub Enterprise at Georgia Tech:

     ssh-keyscan github.gatech.edu >> ~/.ssh/known_hosts
     
  5. Edit (or create) file config in ~/.ssh/. This file is responsible for routing the generic git@github.gatech.edu account to the defined SSH key on the server and on Github. See below for an example config file.

Sample config file

host github.gatech.edu-identifying-text-here
 Host github.gatech.edu
 IdentityFile ~/.ssh/filename-goes-here
 User git

The above configuration routes git repository URLs for Host (github.gatech.edu) to check for the SSH key file under IdentityFile with the git account (User). 

More Information