Notebooks

Working with Git

Clone, pull, and push a repository from a notebook session.

Git works normally here — your home is real disk and your Databaas identity is already set up. Your home is not backed up, so push often.

Clone and push a repository

Create a GitHub token

Git over HTTPS needs a token, not your password. Create a fine-grained personal access token with Contents: Read and write on the repositories you need, and copy it once. See GitHub’s guide.

Clone the repository

Use the Git panel in the JupyterLab sidebar (Clone a Repository), or a terminal:

Clone over HTTPS
git clone https://github.com/<org>/<repo>.git

For the panel, see the jupyterlab-git documentation.

Authenticate once

When git asks for credentials, enter your GitHub username and paste the token as the password. Databaas caches it in ~/.git-credentials on your private home, so later sessions do not ask.

Commit and push

Your name and email are pre-filled from your Databaas login, so commits are attributed to you with no git config step.

Commit and push
git add -A
git commit -m "Explore the transactions table"
git push

Reset a token that expired or was rotated

If pushes start failing, remove the cached credential and authenticate again on your next git command:

Clear the cached token
rm ~/.git-credentials

Push often

Your home is not backed up, so an unpushed commit is the only copy. See notebook storage.