# 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-10-09T14:18:51.469113+00:00` (UTC).

## Primary page

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

## Sections on this page

- [Gitプロバイダーとの連携](https://docs.datarobot.com/ja/docs/workbench/notebook/codespaces/git-provider-cs.html.md#integrate-with-a-git-provider): In-page section heading.
- [Manage Git provider integrations](https://docs.datarobot.com/ja/docs/workbench/notebook/codespaces/git-provider-cs.html.md#manage-git-provider-integrations): In-page section heading.
- [Git CLIを使用した開発](https://docs.datarobot.com/ja/docs/workbench/notebook/codespaces/git-provider-cs.html.md#develop-with-git-cli): In-page section heading.
- [Gitリポジトリからcodespaceを作成する](https://docs.datarobot.com/ja/docs/workbench/notebook/codespaces/git-provider-cs.html.md#create-a-codespace-from-a-git-repository): In-page section heading.
- [次のステップ](https://docs.datarobot.com/ja/docs/workbench/notebook/codespaces/git-provider-cs.html.md#next-steps): In-page section heading.

## 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.[Gitリポジトリから新しいcodespaceを初期化する](https://docs.datarobot.com/ja/docs/workbench/notebook/codespaces/session-cs.html.md) だけでなく、アクティブなセッション中に、codespaceの統合 [ターミナル](https://cli.github.com/) で [Git CLI](https://docs.datarobot.com/ja/docs/workbench/notebook/code-nb/terminal-nb.html.md) を直接使うこともできます。 DataRobotはGitプロバイダーと連携しているため、codespaceでコードを開発する際に、コードのバージョン管理やチームでの共同作業を行うことができます。

## Gitプロバイダーとの連携

Integrate DataRobot with your Git provider to allow DataRobot to access your repositories using the OAuth 2.0 standard. Gitプロバイダーと連携するには、ユーザーアイコンをクリックし、 OAuthプロバイダーの管理 のページを選択します。

OAuthプロバイダーの管理 のページから、連携したいプロバイダーを選択します。 DataRobotでは、GitHub Cloud、GitLab Cloud、Bitbucket Cloud、MicrosoftのAzure Repos、GitLab Enterprise Self-Managed（オンプレミスおよびSTS環境用）との連携をサポートしています。 この連携設定は、Gitプロバイダーのアカウントごとに一度だけ行う必要があります。 以下の例では、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のアクセスを認可します。

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

**GitHubの追加設定**

GitHubの設定には、認可後に追加の手順が必要です。 GitLabまたはBitbucketのアカウントでDataRobotを認可する場合、この追加の設定手順は必要ありません。

Gitプロバイダー のページに戻ると、GitHubの設定ページにアクセスしてDataRobotアプリをインストールするように通知されます。 通知の 権限の管理 をクリックして、GitHubにリダイレクトします。

個人のGitHubアカウントと組織アカウントにDataRobot GitHubアプリをインストールして、そのアカウントに属するリポジトリを操作します。 連携したいアカウントを選択し、そのアカウントに属するすべてのリポジトリに対してDataRobotアプリをインストールして認可するか、選択したリポジトリに対してのみ認可するかを指定します。 DataRobotアプリが個人のGitHubアカウントにインストールされていない場合、Gitとプライベートリポジトリの連携を使用できません。 認可するリポジトリを選択したら、 インストールて認可 をクリックします。

### Manage Git provider integrations

GitプロバイダーのアカウントにインストールされたDataRobotアプリに対する権限を表示および管理するには、対応するプロバイダーのメニューアイコンに移動し、 github.comで管理 をクリックします（URLは選択したプロバイダーによって変わります）。 これにより、対応するGitプロバイダーサイトにリダイレクトされ、認可とアクセス権限の設定が表示されます。

以下の表は、一般的なOAuthプロバイダーの認可を管理する場所のリストです。

| プロバイダー | アプリの場所 | 備考 |
| --- | --- | --- |
| GitHub | Githubアプリケーションのインストール設定ページおよびGitHubアプリケーションの認可 | アプリの認可セクションではアカウントの認可を設定および取り消すことができ、インストールの設定ページではアカウントのリポジトリに対するGitHubアプリのアクセス権限を設定できます。 OAuth管理インターフェイスを使用して、他の組織のアプリケーション構成を確認できる特定のアプリケーション設定ページに移動します。 |
| GitLab | Gitlabアプリケーションの設定 | 設定の詳細については、認可されたアプリケーションの表を参照してください。 |
| Bitbucket | Bitbucketアプリの認可 | N/A |
| Microsoft | Microsoftアプリの認可 | N/A |

To remove DataRobot's authorization to your Git provider account, click Revoke authorization. DataRobotはアカウントにアクセスできなくなり、関連付けられているすべてのメタデータを削除します。 ただし、APIの制限により、DataRobotが認可を完全に取り消すことができないため、DataRobotアプリがGitプロバイダーの認証済みアプリに表示される場合があります。

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.

Gitプロバイダーのサイトで認可を取り消しても、DataRobotの設定では取り消していない場合、次回、対応するGitアカウントのリポジトリに対するcodespaceでGit操作を使用すると、認可が期限切れとして検出されます。 この連携を再び使用するには、そのGitプロバイダーアカウントに対してDataRobotを再認可する必要があります。

> [!NOTE] 追加プロバイダーの管理
> DataRobotで認証プロバイダーの連携を管理する方法の詳細については、 [OAuthプロバイダーの管理](https://docs.datarobot.com/ja/docs/platform/acct-settings/manage-oauth.html.md) を参照してください。

### Git CLIを使用した開発

Gitプロバイダーに対してDataRobotを認可したら、ターミナルからcodespaceセッションでGit CLIを使い始めることができます。 DataRobotがユーザーに代わって自動的に認証を処理するため、Git CLIコマンドを実行するたびに個人用アクセストークン（PAT）を使用してGitアカウントを手動で認証する必要はありません。 DataRobotは、バックグラウンドでカスタムのGit資格情報ヘルパーを使用してこれを実現しています。

> [!NOTE] Git CLIの認証
> この自動認証フローは現在、Git CLIでのみサポートされており、 GitHub CLI ではサポートされていません。 GitHub CLIをcodespaceで使用したい場合は、ターミナルで `gh` コマンドを使用する際に、パーソナルアクセストークン（PAT）を使って手動で認証する必要があります。 PATは `GH_TOKEN` または `GITHUB_TOKEN` 環境変数として設定できます。 `gh` はその環境変数の値を使って認証します。

Git認証は個々のユーザーレベルで処理されます。 複数のユースケースメンバーがユースケース内の同じ共有codespaceにアクセスできる場合でも、DataRobotは、アクティブなcodespaceセッションを開始したユーザーの代わりに、そのユーザーの認可されたGitプロバイダーアカウントに基づいてのみ認証を試みます。

リモートGitリポジトリのクローンを作成し、それらのリポジトリとの間で変更内容をプッシュおよびプルするだけで、追加の認証手順は必要ありません。

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

カスタム環境でcodespaceを使用している場合、Git連携機能では、プライベートGit認証用のDataRobot Gitヘルパーバイナリをカスタム環境イメージに含める必要があります。

```
# 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 
```

カスタム環境を設定するためのDockerfileの設定方法のエンドツーエンドの例として、 [サンプル環境のテンプレート](https://github.com/datarobot/datarobot-user-models/blob/master/public_dropin_notebook_environments/python311_notebook_base/Dockerfile) を使用できます。

### Gitリポジトリからcodespaceを作成する

既存の外部Gitリポジトリのコードでインスタンス化された新しいcodespaceを作成する場合は、ユースケースに移動して、 追加 > Codespace > Codespaceをアップロード を選択します。

パブリックリポジトリのクローンを作成する場合は、GitクローンのURLを指定します（対応するGitプロバイダーとの連携を追加している必要はありません）。

プライベートリポジトリからcodespaceを作成するには、 プライベートリポジトリ タブを選択し、ドロップダウンからプロバイダーを選択します。 ここに表示されるのは、すでに認可済みのプロバイダーだけです。

クローンを作成したいリポジトリを選択します。 デフォルトでは、最近更新されたリポジトリが リポジトリ ドロップダウンに表示されます。 特定のリポジトリを検索するには、検索フィールドに入力します。

Gitリポジトリから新しいcodespaceを作成するだけでなく、codespaceターミナルで [Git CLIを使用](https://docs.datarobot.com/ja/docs/workbench/notebook/codespaces/git-provider-cs.html.md#develop-with-git-cli) して、既存のcodespaceにGitリポジトリを直接複製することもできます。

## 次のステップ

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.
