Skip to main content

Github <> JupyterHub

S
Written by Satya Singh
Updated over 2 months ago

Pre Requisite

  • Github account

  • Scispot account with JupyterHub enabled

  • Scispot account with Github integration enabled

Functionality

  • Customers with JupyterHub access have the option to sync scripts stored in JupyterHub with a Github repository

  • This article will go through setting up the SSH authentication for Github as well as using the Git GUI extension for JupyterLab, but using the terminal to run git commands is also supported for more advanced Git usage


Steps to Sync Jupyter Hub with a Github Repo

  • Go to App Store and click the Github card

  • Add a github connector

  • Copy the ENTIRE SSH key displayed in the modal. If it says "No public SSH key found" please contact your account manager to activate your GIthub sync functionality.

  • In your Github account, click the Github account settings icon in the top right corner

  • Click the settings page

  • Click the SSH and GPG keys page

  • Click new SSH key to your Github account

  • Name the SSH key "Scispot" and paste the ssh key into the key input. After, click "Add SSH key"

  • Confirm SSH key creation with your Github account password

  • Create a new private Github repo in your GIthub account or go to an existing one.

  • Once setup, go click on "Code" and switch to the "SSH" tab. Copy the SSH URL.

  • Now swap to JupyterLab and open up the terminal

  • In the terminal type "git clone " and paste (hotkey: shift + ins) the SSH URL you've copied earlier

  • This will clone the Github repo into a new folder, in this example it is the scispot-jupyterlab-scripts folder. Navigate to this folder then click on the Git extension tab on the left to open up the Git GUI.


Using Git in JupyterLab

  • Now after making some changes we can click this "+" button to stage our changes, add a commit message and then commit the change

  • If it's your first time commiting, you'll be prompted to add a name and email for this commit. This will be saved for any subsequent commit, but can be changed using Git commands

  • Now after commiting we can then click on this button to push to remote

  • You should then receive a notification on the bottom right of your screen with a success message.

  • Checking on Github you will then see the user that was setup from before pushing changes

  • We can also pull changed from remote using this button

  • Note: This is simply a tutorial on using the Git GUI. Any git commands are also available using the terminal.

Did this answer your question?