#

Git and Github on Odyssey

We strongly encourage all persons writing code (C, C++, Fortran, R, etc) to make use of the version control system git. The git suite of tools is available on odyssey without having to do a module load, and is available on all login and compute nodes.

Using Github, however, may be a little less straightforward. If you cloning Github repos using the http:// or https:// protocol, you will experience authorization issues that you may not have experienced on your desktop or laptop. For this reason, we strongly encourage you to use the SSH protocol instead, in conjunction with a personal, Odyssey public SSH key that needs to be included in your Github account preferences.

Please follow the instructions at https://help.github.com/articles/generating-ssh-keys/ to generate your key on Odyssey. Briefly

  1. Log into Odyssey.
  2. Generate your SSH key according to Github's directions. There is no need to follow step 3 (Add your key to the ssh-agent).

If you now clone a Github repo on Odyssey with the SSH protocol, you should be good to go.

For Existing Repositories: If you've already cloned a Github repo using http:// or https://, you can switch to SSH with these simple directions:

  1. In the terminal and on Odyssey, ensure you are inside the top level or one of the directories of your repository.
  2. On Github, navigate to the repository you had cloned, switch to the SSH protocol, and copy the link. The protocol should look something like git@github.com....
  3. Issue the command git remote set-url origin URL, where URL is the link you copied in the previous step (e.g. git@github.com....).
  4. Use the command git remote -v to see if there are other remote repository URLs that you need to set.

You should now be able to issue the git push command without error.

Last updated: February 25, 2016 at 12:09 pm

CC BY-NC 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. Permissions beyond the scope of this license may be available at Attribution.