ODH Logo

Store your changes on your GitHub repo

If you don’t have a GitHub token, you can create one following GitHub docs: create GitHub token.

Push your changes using JupyterLab Git extension

If you are running this tutorial on Operate First your work-in-progress notebooks can be saved in your JupyterHub PVC by hitting the save button on the top panel. Nevertheless, it is a good practice to push your changes to the GitHub repo when you finish working on your project, so that all your work can be saved.

In order to do that from within JupyterHub using the Jupyterlab Git extension:

  1. Go to Git Box panel on the left to check what files have been changed.

    Go to Git Box Panel
  2. Stage the files you want to push to your GitHub repo.

    Stage the files
  3. Add Summary of your changes (a.k.a commit message) and select Commit.

    Commit Changes

    NOTE: If you are doing this for the first time, git requires user email and user name to be set.(The extension will open a Dialog Form to insert them)

    Insert User Name and Email
  4. Select Push Changes.

    Use Button to Push Changes
  5. Insert your Github account name and your GitHub token to push to the GitHub repo you cloned.

    Push Changes with GitHub token

Push your changes using the terminal in JupyterLab

Jupyterlab Git extension is limited to one repository at the moment. Therefore if you want to clone another repo and push changes you need to use the git commands from the Terminal.

  1. Open terminal from the icon in the Launcher.

    Open Terminal
  2. Start using the git commands:

    Use Git Commands
  3. git clone <repo> to clone a new repo.
  4. git add <file> after you modify files to put them in stage.
  5. git commit -m "<commit message>" to commit the changes in stage. NOTE: If you are doing this for the first time, git requires user email and user name to be set.

    First commit
  6. git push origin <branch> to push your changes.

Open Pull Request against the repo you want to contribute

Once you are satisfied with your changes you can open a Pull Request directly from your fork.

Next Step

Set bots and pipelines to create releases, build images and enable dependency management