You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

To be able to commit changes to a github hosted repository, now github requires you to use ssh to checkout and push changes. To do this you need to generate an ssh key and publish it on the github web page. github doesn't allow you to register the same ssh key for multiple repositories, so if you have multiple repositories you wish to contribute to from the same host computer there needs to be a little bit of ssh voodoo. The following assumes the use of OpenSSH on either unix or windows. For Windows, you can install the OpenSSH client from the app menu in Settings. Also for Windows, you need to have the "OpenSSH Authentication Agent" running (run from Services app).


  • Generate a unique ssh key for each repository using ssh-keygen command line tool
    • For Windows, also use ssh-add command line tool to add private keys to ssh agent

  • Add public keys to each repository on github from settings tab

  • Generate a config file in your ssh directory (e.g. ~username/.ssh/config) with an entry for each repository and matching ssh key, e.g.:

Host github.com:slaclab/Lucretia.git
        Hostname github.com
        IdentityFile ~/.ssh/id_lucretia

Host github.com:slaclab/facet2-lattice.git
        Hostname github.com
        IdentityFile ~/.ssh/id_facet2-lattice

now you can clone with git clone git@github.com:slaclab/facet2-lattice.git etc and successfully perform push/pull operations and so on.


  • No labels