# Use Git repositories

> Use Git repositories - Run and manage a DataRobot codespace session.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-09-30T19:40:40.957068+00:00` (UTC).

## Primary page

- [Use Git repositories](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/git-provider-cs.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [Integrate with a Git provider](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/git-provider-cs.html.md#integrate-with-a-git-provider): In-page section heading.
- [Manage Git provider integrations](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/git-provider-cs.html.md#manage-git-provider-integrations): In-page section heading.
- [Develop with Git CLI](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/git-provider-cs.html.md#develop-with-git-cli): In-page section heading.
- [Create a codespace from a Git repository](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/git-provider-cs.html.md#create-a-codespace-from-a-git-repository): In-page section heading.
- [Next steps](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/git-provider-cs.html.md#next-steps): In-page section heading.

## Related documentation

- [NextGen UI documentation](https://docs.datarobot.com/en/docs/workbench/index.html.md): Linked from this page.
- [DataRobot Notebooks](https://docs.datarobot.com/en/docs/workbench/wb-notebook/index.html.md): Linked from this page.
- [Codespaces](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/index.html.md): Linked from this page.
- [initializing a new codespace from a Git repo](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/session-cs.html.md): Linked from this page.
- [terminal](https://docs.datarobot.com/en/docs/workbench/wb-notebook/wb-code-nb/wb-terminal-nb.html.md): Linked from this page.
- [Manage OAuth providers](https://docs.datarobot.com/en/docs/platform/acct-settings/manage-oauth.html.md): Linked from this page.
- [Codespace scheduling](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/schedule-cs.html.md): Linked from this page.
- [Manage the notebook environment](https://docs.datarobot.com/en/docs/workbench/wb-notebook/wb-code-nb/wb-env-nb.html.md#manage-the-notebook-environment): Linked from this page.

## Documentation content

Notebooks are represented as `.ipynb` files in a codespace, which allows you to version both your notebook and non-notebook files using an external Git repository. In addition to [initializing a new codespace from a Git repo](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/session-cs.html.md), you can directly use the [Git CLI](https://cli.github.com/) in a codespace's integrated [terminal](https://docs.datarobot.com/en/docs/workbench/wb-notebook/wb-code-nb/wb-terminal-nb.html.md) during an active session. DataRobot integrates with Git providers for you to version your code and collaborate with your team when developing code in a codespace.

## Integrate with a Git provider

Integrate DataRobot with your Git provider to allow DataRobot to access your repositories using the OAuth 2.0 standard. To integrate with your Git provider, click your user icon and select the OAuth provider management page.

From the OAuth provider management page, select the provider that you want to integrate with. DataRobot supports integrations with GitHub Cloud, GitLab Cloud, Bitbucket Cloud, Microsoft's Azure Repos, and GitLab Enterprise Self-Managed (for on-prem and STS deployments). You only need to complete this integration setup once per Git provider account. The example below outlines authentication with GitHub Cloud.

After choosing a provider, click the actions menu icon () and select Authorize on github.com (the URL will change depending on the provider selected).

DataRobot redirects you to the provider's login page. Sign in to your account and authorize DataRobot's access.

Once authorized, DataRobot redirects you to the Git providers page.

**Additional GitHub configuration**

GitHub configuration requires an additional step after authorization. Authorizing DataRobot to GitLab or Bitbucket accounts does not require this additional configuration step.

When you return to the Git providers page, DataRobot notifies you to visit the settings page on GitHub to install the DataRobot App. Click Manage Permissions in the notification to get redirected to GitHub.

Install the DataRobot GitHub app on your personal GitHub account and any organization accounts to work with the repositories that belong to them. Select the account you want to integrate with and specify whether you want to install and authorize the DataRobot App for all repositories belonging to that account, or only select repositories. If the DataRobot app is not installed on your personal GitHub account, you will not be able to use the Git integration with your private repositories. After selecting the repositories to authorize, click Install & Authorize.

### Manage Git provider integrations

To view and manage the permissions for the DataRobot App installed on your Git provider account, navigate to the menu icon for that corresponding provider and click Manage on github.com (the URL will change depend on the provider selected). This redirects you to the corresponding Git provider site to view your authorizations and permissions settings.

The table below provides a list of locations to manage authorization for common OAuth providers.

| Provider | App location | Notes |
| --- | --- | --- |
| GitHub | Github application installation settings page and GitHub application authorizations | The App Authorization section helps to configure and revoke your account authorization, while the Installation settings page helps to configure Github App permissions to repositories for your account. Use the OAuth Management interface to go to the specific application settings page where you can find application configurations for other organizations. |
| GitLab | Gitlab application settings | View the authorized applications table for configuration details. |
| Bitbucket | Bitbucket app authorizations | N/A |
| Microsoft | Microsoft app authorizations | N/A |

To remove DataRobot's authorization to your Git provider account, click Revoke authorization. DataRobot will no longer have access to your account and will delete any associated metadata. However, the DataRobot App may still appear in the Git provider's authenticated app, due to API limitations that prevent DataRobot from fully revoking authorization.

For GitLab and Bitbucket, once you’ve removed authorization, you must complete an additional step in the provider's settings to revoke authorization of the DataRobot OAuth app. For example, in GitLab, revoke the authorization on the Applications page in the GitLab user settings.

In the case where you have revoked authorization on your Git provider’s site but not in DataRobot settings, the authorization will be detected as expired the next time you use Git operations in a codespace for a repository in that corresponding Git account. You will need to re-authorize DataRobot to that Git provider account in order to use this integration again.

> [!NOTE] Manage additional providers
> For more information on managing authentication provider integrations in DataRobot, see [Manage OAuth providers](https://docs.datarobot.com/en/docs/platform/acct-settings/manage-oauth.html.md).

### Develop with Git CLI

Once you have authorized DataRobot to your Git provider, you can start using the Git CLI in your codespace sessions from the terminal. You will not need to manually authenticate to your Git account using a personal access token (PAT) each time you run a Git CLI command, as DataRobot automatically handles authentication on your behalf. Behind the scenes, DataRobot uses a custom Git credential helper to accomplish this.

> [!NOTE] Git CLI authentication
> This automatic authentication flow is currently only supported for the Git CLI, and not the GitHub CLI. If you want to use the GitHub CLI in a codespace, you will need to manually authenticate with your personal access token (PAT) when using `gh` commands in the terminal. You can set your PAT as a `GH_TOKEN` or `GITHUB_TOKEN` environment variable.`gh` will authenticate using that environment variable value.

Git authentication is handled at the individual user level. Even if multiple use case members have access to the same shared codespace in a use case, DataRobot will only attempt to authenticate on behalf of the user who has started the active codespace session based on that user’s authorized Git provider account(s).

You can simply clone remote Git repos and push and pull changes to and from those repos without any additional authentication steps required:

```
git clone https://github.com/<my-account>/<my-repo>
git pull
```

If you are using a codespace with a custom environment, Git integration functionality requires the custom environment image to include the DataRobot Git helper binary for private Git authentication:

```
# Install the Git helper binary used for private git authentication in notebooks and codepaces
RUN curl -L -o drgithelper https://github.com/datarobot-oss/drgithelper/releases/download/v0.0.9/drgithelper && chmod +x drgithelper
```

You can use a [sample environment template](https://github.com/datarobot/datarobot-user-models/blob/master/public_dropin_notebook_environments/python311_notebook_base/Dockerfile) as an end-to-end example of how to configure the Dockerfile for configuring a custom environment.

### Create a codespace from a Git repository

If you would like to create a new codespace instantiated with code from an existing external Git repository, navigate to a Use Case and select Add > Codespace > Upload codespace.

If you are cloning a public repo, provide the Git clone URL (this does not require you to have added an integration with the corresponding Git provider).

To create a codespace from a private repository, select the Private repository tab and choose the provider from the dropdown. Only providers that you have already authorized appear here.

Select the repository you wish to clone. By default, DataRobot displays the most recently updated repositories in the Repository dropdown. Type in the search field to find a specific repository.

In addition to creating a new codespace from a Git repo, you can also directly clone a Git repo into an existing codespace [using the Git CLI](https://docs.datarobot.com/en/docs/workbench/wb-notebook/codespaces/git-provider-cs.html.md#develop-with-git-cli) in the codespace terminal.

## Next steps

With a codespace session running, automate notebook runs on a schedule or use the integrated terminal to manage your environment further.

- Start a session : Start a codespace session.
- Codespace scheduling : Automate code-based workflows by scheduling notebooks in a codespace to run in non-interactive mode.
- Notebook terminals : Use the integrated terminal to run shell commands, install packages, and execute scripts in a codespace session.
- Manage the notebook environment : Configure the resource type, environment image, and inactivity timeout for a codespace session.
