Save a notebook to GitHub

Vertex AI Workbench user-managed notebooks isdeprecated. On April 14, 2025, support for user-managed notebooks ended and the ability to create user-managed notebooks instances was removed. Existing instances will continue to function until March 30, 2026, but patches, updates, and upgrades won't be available. To continue using Vertex AI Workbench, we recommend that youmigrate your user-managed notebooks instances to Vertex AI Workbench instances.

To back up your user-managed notebooks instance and make it availableto others, save the contents of your user-managed notebooks instanceto GitHub.

Create a GitHub repository

If you don't already have aGitHub 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.

Initialize a GitHub repository with a README file.

Clone your GitHub repository in your user-managed notebooks instance

To clone your GitHub repository in your user-managed notebooksinstance, complete the following steps:

  1. In your GitHub repository, click theCode button,and then click theLocal tab.

  2. Copy theHTTPS URL.

  3. In the Google Cloud console, go to theUser-managed notebooks page.

    Go to User-managed notebooks

  4. ClickOpen JupyterLab to openyour user-managed notebooks instance.

  5. In the JupyterLab File Browser, selectthe folder where you want to clone the GitHub repository. For example,the home folder.

    Notebook home folder.

  6. In JupyterLab, selectGit > Clone a Repository.

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

  8. In theClone a repo dialog, paste the HTTPS URL for your GitHub repository.

    Paste repository URL and clone.

  9. ClickClone.

Configure your user-managed notebooks instance with your GitHub user information

  1. In JupyterLab, selectGit > Open Git Repository in Terminalto open a Git terminal window.

  2. In the Git terminal window, enter the following commands to configureyour Git username and email:

    git config --global user.name "YOUR_NAME"git config --global user.email "YOUR_EMAIL"
  3. If your GitHub account requires SSH authentication, completethe following steps to connect your account:

    1. From your Git terminal in your user-managed notebooksinstance, follow GitHub'sinstructions for generating a new SSH key.

    2. Follow theinstructions for adding that SSH key to your GitHubaccount.

  4. Close the Git terminal window.

Add your committed files to your GitHub repository

  1. Your user-managed notebooks instance shows your repositoryas a new folder. If you don'tsee your cloned GitHub repository as a folder, click theRefresh FileList button.

    Refresh File List button.

  2. Double-click your repository folder to open it.

  3. Add a new notebook to your user-managed notebooks instance.

    To add a notebook file, you can use the menu or the Launcher.

    Menu

    1. To add a new notebook file from the menu, selectFile > New > Notebook.

      Add a notebook file.

    2. In theSelect kernel dialog, select the kernel for your newnotebook, for example,Python 3, and then clickSelect.

      Your new notebook file opens.

    Launcher

    1. To add a new notebook file from the Launcher, selectFile > New > Launcher.

    2. Click the tile for the kernel you want to use.

      Add a notebook file.

      Your new notebook file opens.

  4. Rename your new notebook file.

    Menu

    1. SelectFile > Rename notebook. TheRename file dialog opens.

    2. In theNew name field, changeUntitled.ipynb to somethingmeaningful, such asinstall.ipynb.

    3. ClickRename.

    Launcher

    1. Right-click theUntitled.ipynb tab and then clickRename notebook. TheRename file dialog opens.

    2. In theNew name field, changeUntitled.ipynb to somethingmeaningful, such asinstall.ipynb.

    3. ClickRename.

  5. Select theGit tab. Your new notebook is listed in theUntrackedgrouping.

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

  7. To commit your new notebook to your GitHub repository, on theGit tab,add a commit comment and clickCommit.

  8. To open a Git terminal window, selectGit > Open Git repository in terminal.

  9. In the Git terminal window, enter thegit push command.

    • If you use a GitHub username and password, when prompted, enter yourGitHub username and password.

    • If you use two-factor authentication with GitHub,create a personal access token to use.

    When thegit push command completes, your committed files are inyour GitHub repository.

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 2025-11-24 UTC.