Sign inGet started

Export notebooks to GitHub

Deepnote lets you export your notebooks to GitHub, opening up new development workflows and improving collaboration within your team or wider community.

You can easily export all your notebooks in open-sourced format from Deepnote to GitHub without touching the terminal.

Exporting notebooks to GitHub unlocks new possibilities and workflows, such as:

  • Archiving or backing up your notebooks.
  • Leveraging GitHub to trigger automated testing and deployment pipelines whenever changes are made to your notebooks.
  • Tracking changes made to your notebooks over time, reviewing them, and reverting them as needed.
  • Enhancing collaboration, accessibility, and reproducibility of your work.

Adding a repository

First, click on the plus icon in the sidebar Versions section.

git-export-9.png

Deepnote connects to GitHub through a GitHub app.

Click on "Add GitHub repositories" to install the Deepnote GitHub app on your organization's or personal GitHub account.

git-export-10.png

In GitHub, you can configure the GitHub App to have access to all your organization's repositories or specific ones. This process only needs to be completed once per GitHub account or organization. Please note that if you use multiple workspaces, you have to complete the process for every workspace.

In case you want to add repositories from another Github organization, open the repository dropdown and click on the "Add GitHub repositories" button.

Once the GitHub App is installed, you can select the repository you want to add to Deepnote. In addition to the repository, you need to specify the path to which all the project notebooks will be exported, and the branch to which the changes will be committed & pushed. The branch you specify must exist in the repository.

git-export-11.png

Exporting notebooks

To export all project notebooks to GitHub click the Commit & push button.

git-export-12.png

Add the commit message with a description, and export it.

Once exported, all project notebooks will be in GitHub. The notebooks are saved in open-source .ipynb format. Note that the block outputs, which may contain sensitive data, are also included. If you wish to not commit the output of a specific block, you can clear the output of that specific block before committing.

The commits that Deepnote creates are based on the latest commit in the remote branch, and no files other than the notebooks are overwritten. It is possible to use the same GitHub repository for multiple Deepnote projects - and also for other tools your might be using to export your code.

GitHub exports are also integrated into Deepnote's native versioning functionality. Each commit creates a new version of the project, which you can quickly preview or restore from the project version history.

git-export-13.png

Troubleshooting

Repositories not loading

If you don't see your repositories in the list after finishing the authorization process in Github, your GitHub organization may already be connected to another workspace in Deepnote. To fix this:

  1. Trigger the authorization process again from the new workspace
  2. Click on "Configure" button for your organization in GitHub
  3. Add the relevant repository in "Repository access" section
  4. Click on Save. This will connect your GitHub organization to the new workspace.
Unable to commit & push

To export the notebook to GitHub, the repository must contain the specified branch, and it can't be empty (it has at least one initial commit).

Revoking access

If you no longer want Deepnote to access some or all of your repositories, you can either revoke access to some repositories or uninstall the Deepnote GitHub application completely in your organization's GitHub settings at https://github.com/organizations/<your-organization>/settings/installations.