Save a notebook to GitHub
This page describes how you can save your Vertex AI Workbench instance'snotebook files to GitHub by using thejupyterlab-git extension. You mightdo this to create a backup of the notebook or to make the notebookavailable to others.
In Vertex AI Workbench instances, you can use thejupyterlab-gitextension to help you with version control. To learn more, seejupyterlab-giton GitHub.
Create a GitHub repository
If you don't already haveaGitHub repository,you must create one.
When you create your GitHub repository make sure that your GitHub repositorycan be cloned by selecting theInitialize this repository with a READMEcheckbox.

Clone your GitHub repository in your Vertex AI Workbench instance
To clone your GitHub repository in your Vertex AI Workbench instance,complete the following steps:
In your GitHub repository, click theCode button,and then click theLocal tab.
Copy theHTTPS URL.
In the Google Cloud console, go to theInstances page.
ClickOpen JupyterLab to openyour Vertex AI Workbench instance.
In the JupyterLab File Browser, selectthe folder where you want to clone the GitHub repository. For example,the home folder.

In JupyterLab, selectGit > Clone a Repository.
In theClone a repo dialog, paste the HTTPS URL foryour GitHub repository.

If prompted, enter your credentials.
If you use a GitHub username and password, enter yourGitHub username and password.
If you use two-factor authentication with GitHub,create and use apersonal accesstoken.
ClickClone.
Your Vertex AI Workbench instance shows your repositoryas a new folder. If you don't see your cloned GitHub repositoryas a folder, click theRefresh File List button.

Configure your instance with your GitHub user information
In JupyterLab, open the folder where your repository is located.
SelectGit > Open Git Repository in Terminalto open a Git terminal window.
In the Git terminal window, enter the following commands to configureyour Git username and email:
git config --global user.name "USERNAME"git config --global user.email "EMAIL_ADDRESS"
Replace the following:
USERNAME: your GitHub usernameEMAIL_ADDRESS: your GitHub account email address
If your GitHub account requires SSH authentication, completethe following steps to connect your account:
From your Git terminal in your Vertex AI Workbenchinstance, follow GitHub'sinstructions for generating a newSSH key.
Follow theinstructions for adding that SSH key to your GitHubaccount.
Close the Git terminal window.
Add your committed files to your GitHub repository
In JupyterLab, open the folder where your repository is located.
Select theGit tab. Your new notebook is listed in theUntrackedgrouping.
To add the new notebook as a file for your GitHub repository, right-clickthe new notebook and selectTrack. On theGit tab, your notebookis now added to theStaged grouping.
To commit your new notebook to your GitHub repository, on theGit tab,in theSummary field, add a commit comment, and then clickCommit.
SelectGit > Push to Remote.
If you use a GitHub username and password, when prompted, enter yourGitHub username and password.
If you use two-factor authentication with GitHub, enter yourGitHub username and personal access token.
After the
git pushcommand completes, your committed files are inyour GitHub repository.
What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.