Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex DataSphere
  • Getting started
    • All guides
      • Connecting to JupyterLab from a local IDE
      • Selecting computing resources
      • Checking GPU load
      • Getting a notebook ID
      • Installing packages
      • Notebook code snippets
      • Clearing notebook cell outputs
      • Working with Git
      • Setting up template-based notebook creation
    • Migrating a workflow to a new version
  • Terraform reference
  • Audit Trails events
  • Access management
  • Pricing policy
  • Public materials
  • Release notes

In this article:

  • Getting started
  • Cloning a public GitHub repository
  • Cloning a private GitHub repository
  • Creating a local repository
  • Creating a new branch
  • Writing changes to a local repository
  • Pushing changes to a remote GitHub repository
  • Pulling changes from a remote repository
  • Saving results to GitHub
  1. Step-by-step guides
  2. DataSphere Notebook
  3. Working with Git

Working with Git

Written by
Yandex Cloud
Updated at October 11, 2024
  • Getting started
  • Cloning a public GitHub repository
  • Cloning a private GitHub repository
  • Creating a local repository
  • Creating a new branch
  • Writing changes to a local repository
  • Pushing changes to a remote GitHub repository
  • Pulling changes from a remote repository
  • Saving results to GitHub

Getting startedGetting started

Open the DataSphere project:

  1. Select the relevant project in your community or on the DataSphere homepage in the Recent projects tab.

  2. Click Open project in JupyterLab and wait for the loading to complete.
  3. Open the notebook tab.

Cloning a public GitHub repositoryCloning a public GitHub repository

To clone an existing public repository:

  1. Under File Browser in the left-hand navigation menu, create or select a folder you want to clone the repository to, then go to that folder.
  2. In the top menu, click Git and select Clone a Repository.
  3. In the window that opens, specify the repository URI and click Clone.

You will see the cloned repository folder in the File Browser section.

Cloning a private GitHub repositoryCloning a private GitHub repository

To work with a private repository, you need a personal access token for GitHub.

Clone an existing private repository:

  1. Under File Browser in the left-side navigation menu, create or select a folder you want to clone the repository to, then go to that folder.
  2. In the top menu, click Git and select Clone a Repository.
  3. In the window that opens, specify the repository URI and click Clone.
  4. In the window that opens, enter the username and token to access GitHub, and then click Submit.

You will see the cloned repository folder in the File Browser section.

Creating a local repositoryCreating a local repository

To get started with a local repository:

  1. Under File Browser in the left-side navigation menu, create or select a folder you want to clone the repository to, then go to that folder.

  2. In the top menu, click Git and select Initialize a Repository.

  3. In the window that opens, click Yes.

  4. Create a notebook file in the repository folder.

  5. Add the notebook file to version control:

    1. Go to the Git section.
    2. On the Change tab, in the Untracked drop-down list, find the project file.
    3. Next to the file name, click .
  6. Make the initial commit:

    1. In the Summary field, enter the commit name.
    2. In the Description field, enter a description for the commit.
    3. Click Commit.
    4. In the window that opens, enter the name and email address of the commit author.
    5. Click OK.

The local repository is ready to go.

Creating a new branchCreating a new branch

  1. Under File Browser in the left-side navigation menu, create or select a folder you want to clone the repository to, then go to that folder.

  2. Under Git, expand the Current Branch drop-down list.

  3. Click New Branch.

  4. In the window that opens:

    1. In the Name field, enter a name for the new branch.
    2. In the list, select the branch that the new one will be based on. To quickly search for the desired branch, use a filter.
    3. Click Create branch.

The created branch will display in the list and will become active.

Writing changes to a local repositoryWriting changes to a local repository

To edit data and write changes to a repository:

  1. Change the files that are under version control.

  2. In the top menu, click File and select Save All to save the changes.

  3. In the left-hand navigation menu, go to Git.

  4. The edited files will be displayed in the Changes list of the Changes tab. The letter M next to the file name means that the file has been changed.

  5. Next to the file name, click . The changes are indexed and the file is moved to the Staged list.

  6. To commit the changes:

    1. In the Summary field, enter the commit name.
    2. In the Description field, enter a description for the commit.
    3. Click Commit.
    4. In the window that opens, enter the name and email address of the commit author.
    5. Click OK.

The changes are written to the repository.

Pushing changes to a remote GitHub repositoryPushing changes to a remote GitHub repository

To work with a private repository, you need a personal access token for GitHub.

To push the saved changes to the remote repository:

  1. In the left-hand navigation menu, go to Git.

  2. Click Push committed changes.

  3. In the window that opens:

    1. Enter the name of a user with write access to the remote repository.
    2. Enter your personal access token for GitHub.
  4. Click OK.

  5. Wait until Successfully pushed appears.

    Changes are pushed to the remote repository.

Pulling changes from a remote repositoryPulling changes from a remote repository

  1. Go to the Git section.

  2. Click Pull latest changes.

  3. Wait until Successfully pulled appears.

    Changes are pulled from the remote repository.

Saving results to GitHubSaving results to GitHub

To work with a private repository, you need a personal access token for GitHub.

To save a project code to a new repository on GitHub:

  1. Create a new empty repository on GitHub. You can add README, license, and gitignore files later.

  2. Create a local repository in the DataSphere project:

    1. Under File Browser in the left-side navigation menu, create or select a folder you want to clone the repository to, then go to that folder.
    2. In the top menu, click Git and select Initialize a Repository.
    3. In the window that opens, click Yes.
  3. Map the local repository to the remote GitHub repository:

    1. In the top menu, click Git and select Manage Remote Repositories.
    2. In the window that opens, enter the remote repository's name and address and click Add.
    3. Close the window for adding remote repositories.
  4. Add all required files to version control:

    1. Go to the Git section.
    2. In the Untracked drop-down list under the Change tab, find the project file.
    3. Next to the file name, click .
  5. Make the initial commit:

    1. In the Summary field, enter the commit name.
    2. In the Description field, enter a description for the commit.
    3. Click Commit.
    4. In the window that opens, enter the name and email address of the commit author.
    5. Click OK.
  6. Push changes to the remote repository:

    1. In the top menu, click Git and select Push to Remote.
    2. In the window that opens, enter the username of the GitHub user you are going to work under and the token to access GitHub.

As a result, the GitHub repository should contain the files that you added to version control.

Was the article helpful?

Previous
Clearing notebook cell outputs
Next
Setting up template-based notebook creation
© 2025 Direct Cursus Technology L.L.C.