Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Source control in notebooks

Commit, branch and restore your projects with Git, and use code from your repositories.

Once you've connected a Git provider, each project has source control. Open the source control sidebar with Ctrl+6 (Windows) or ⌘+6 (Mac).

Connecting a project to a repository

  1. In source control, choose where the project's code is saved:

    Provider
    Choose

    GitHub

    Repository and branch

    Bitbucket

    Workspace, repository and branch

    Azure DevOps

    Organization, project, repository and branch

  2. Set the branch path: the folder in the branch where this project is saved. It defaults to the project's ID; you can change it to any name.

To save to a new repository, create it with your Git provider first.

Committing

Enter a commit message, then commit. Zerve pushes the project's code and structure to the repository. Each commit appears in the project's commit history.

What's saved

File or folder
What it holds

canvas.yaml

The project's structure: its layers, global imports, compute settings and the connections between blocks

A folder for each layer

The layer's code, as .py files, and a layer.yaml describing the layer

Comparing versions

Use the commit history to see past commits, and compare versions block by block with the diff viewer.

Working on a branch

  1. Select Create Branch, and name the branch. Zerve opens a copy of the project on the new branch.

  2. Make and commit your changes on the branch.

  3. Select Create Pull Request to open a pull request with your Git provider, so others can review it.

  4. Merge the pull request with your Git provider.

  5. In the main project, pull the latest changes to bring the merged work in.

Restoring an earlier version

Choose an earlier commit to restore. Zerve creates a new copy of the project at that version, leaving the current one unchanged.

Using code from repositories in your blocks

You can include a repository in a project, so its code can be imported in your blocks, such as your team's shared utilities.

  1. In source control, select Include Repository and choose the repository.

  2. Import its code in your blocks.

If the repository's name has hyphens, use underscores instead in your import statements. For example, a repository named risk-utils is imported as risk_utils.

Last updated

Was this helpful?