# Back up workspace to a Git repository

You can export your Datalore workspaces to Git repositories to back up your notebooks and files and track changes over time.

When you commit and push changes to a Git repository, both you and Datalore are marked as commit authors in the commit history. If conflicts occur, Datalore automatically resolves them using the [ours strategy](https://git-scm.com/docs/merge-strategies#Documentation/merge-strategies.txt-ours) – changes made in Datalore are applied.

Supported Git providers
: Datalore supports backing up workspaces to GitHub, GitLab, and other Git providers that use standard Git commands and API.
:
:
:
: Self-hosted providers are supported too, as long as they can accept SSH connections and do not use any non-standard configuration.
:
:
:
: > **Note:**
: > Datalore allows backups of files up to 10 MB, but your Git provider may have smaller limits.
: >
: >
: >
: > In Datalore On-Premises, you can adjust the limit using the [GIT_BACKUP_FILE_SIZE_LIMIT parameter](server-configuration.html#git-backup-file-size-limit).

Procedure: Configure a Git connection

1. If you have not already, [add an SSH key to the workspace](ssh-keys-in-workspace.html) and your Git provider.

2. On the Home page, select the workspace that you want to back up to a Git repository.

3. Click ![Settings](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/settings.svg)(Settings).

![Workspace settings button in the sidebar](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/workspace-settings.png)

4. Switch to the Git backup tab.

5. Click Connect a Git repository.

6. In the dialog, configure the following settings:

1. Repository SSH URL

2.  SSH key: Select the SSH key you want to use for the connection. To learn how to add an SSH key to the workspace, see [SSH keys](ssh-keys-in-workspace.html).

3.  Branch: (Optional) If you want to back up the notebooks and files to a non-default branch, select it from the dropdown.

4.  Base directory: (Optional) If you want to back up the notebooks and files to a specific directory, enter the directory name. Leave blank to use the repository root.

5.  Exclude cell outputs from backup: (Optional) Enable if you want to back up notebooks without outputs.

6.  File structure: (Optional) Select how you want the notebooks and files to be stored.

* Flat: Notebooks are stored at the root level and not grouped with their files. Workspace files are stored at the root level.

* Grouped by notebook: Each notebook and its files are stored in a dedicated folder. Workspace files are stored separately.

7. To make sure the provided parameters are correct, click Test connection.

8. Click Create connection.

Once the connection is created, you can [back up your workspace](#back-up-workspace).

Procedure: Back up your workspace

1. On the Home page, select the workspace that you want to back up to Git.

2. Select Other and switch to the Git backup tab.

3. (Optional) To refresh the origin state, click Refetch origin.

4. Select the files you want to include in the commit.

![Git backup tab and files selected for commit](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/git-backup.png)

> **Note:**
> You can commit and push new or modified notebook files only together with the notebook they belong to.

5. Enter a commit message.

6. Click Commit and push.

Procedure: Restore a workspace

You cannot currently revert a workspace to a previous version. Instead, you can [create a new workspace from a Git backup](import-workspace-from-git-repository.html).

Procedure: Edit the Git connection

1. On the Home page, select the workspace where you want to edit the Git repository connection.

2. Click ![Settings](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/settings.svg)(Settings).

![Workspace settings button in the sidebar](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/workspace-settings.png)

3. Switch to the Git backup tab.

4. Click Edit the connection.

5. Edit the settings you want to change:

* Repository SSH URL: If you want to change the repository for workspace backups, enter the new URL.

* SSH key: Select the SSH key you want to use for the connection. To learn how to add an SSH key to the workspace, see [SSH keys](ssh-keys-in-workspace.html).

* Branch: Select the branch to back up files and notebooks to.

* Base directory: If you want to back up the notebooks and files to a specific directory, enter the directory name. Leave blank to use the repository root.

* Exclude cell outputs from backup: Enable if you want to back up notebooks without outputs.

* File structure: Select how you want the notebooks and files to be stored. * Flat: Notebooks are stored at the root level and not grouped with their files. Workspace files are stored at the root level. * Grouped by notebook: Each notebook and its files are stored in a dedicated folder. Workspace files are stored separately.

6. To make sure the provided parameters are correct, click Test connection.

7. Click Update connection.

Procedure: Remove a Git connection

1. On the Home page, select the workspace where you want to remove the Git repository connection.

2. Click ![Settings](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/settings.svg)(Settings).

![Workspace settings button in the sidebar](https://resources.jetbrains.com.cn/help/img/datalore/2026.3/workspace-settings.png)

3. Switch to the Git backup tab.

4. Click Edit and then Remove connection.

To be able to back up this workspace again, [configure a new connection](#configure-connection).

## See also

* [Manage history and versions](history.html)

* [Add and manage SSH keys](ssh-keys-in-workspace.html)

* [Import a workspace from a Git repository](import-workspace-from-git-repository.html)

