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
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.
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