Search Docs by Keyword

Table of Contents

Git and Github on the FASRC cluster

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 the cluster 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, cluster 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 the FASRC cluster. Briefly

  1. Log into the cluster.
  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 the cluster 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 the cluster, 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.
[lastupdated]

© The President and Fellows of Harvard College
Except where otherwise noted, this content is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.