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
In source control, choose where the project's code is saved:
ProviderChooseGitHub
Repository and branch
Bitbucket
Workspace, repository and branch
Azure DevOps
Organization, project, repository and branch
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
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
Select Create Branch, and name the branch. Zerve opens a copy of the project on the new branch.
Make and commit your changes on the branch.
Select Create Pull Request to open a pull request with your Git provider, so others can review it.
Merge the pull request with your Git provider.
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.
In source control, select Include Repository and choose the repository.
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?
