# 変更をブランチにエクスポートする

この記事では、codespace の変更をブランチにエクスポートする手順について説明します。

## 変更のエクスポートについて

GitHub Codespaces を使用しているときに、codespace を起動せずにブランチに変更をエクスポートする場合があります。 これは、[使用制限](/ja/billing/managing-billing-for-your-products/managing-billing-for-github-codespaces/managing-the-spending-limit-for-github-codespaces)に達した場合や、codespace へのアクセスで一般的な問題が発生している場合に便利です。

codespace を作成した方法に応じて、いくつかある方法のいずれかで変更をエクスポートできます。 いずれの場合も、codespace で現在チェックアウトされている Git ブランチのみがエクスポートされます。 他のブランチに含まれる作業はエクスポートされません。

* 書き込みアクセス権があるリポジトリから codespace を作成した場合は、そのリポジトリの新しいブランチに変更をエクスポートできます。
* 読み取りアクセス権しかないリポジトリから codespace を作成した場合は、そのリポジトリのフォークに変更をエクスポートできます。 GitHub Codespaces によって新しいフォークを作成するか、リポジトリ用のフォークが既にある場合は既存のフォークに codespace をリンクし、フォークの新しいブランチに変更をエクスポートします。 詳しくは、「[Codespace でソースコントロールを使用する](/ja/codespaces/developing-in-a-codespace/using-source-control-in-your-codespace#about-automatic-forking)」をご覧ください。
* テンプレートから codespace を作成し、まだ発行していない場合は、その codespace を新しいリポジトリに発行できます。

> \[!NOTE]
> GitHub では、100 MiB を超えるファイルを含むプッシュがブロックされます。 コードスペースに大きなファイルが含まれている場合、ブランチまたはフォークに変更をエクスポートすることはできません。 詳しくは、「[GitHub での大きいファイルについて](/ja/repositories/working-with-files/managing-large-files/about-large-files-on-github)」をご覧ください。

## 変更をブランチにエクスポートする

次の手順では、ブランチまたはフォークに変更をエクスポートする方法について説明します。 発行されていない codespace の新しいリポジトリへのエクスポートについては、「[テンプレートから codespace を作成する](/ja/codespaces/developing-in-a-codespace/creating-a-codespace-from-a-template#publishing-from-githubcom)」をご覧ください。

1. GitHub の左上隅にある <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-three-bars" aria-label="Open global navigation menu" role="img"><path d="M1 2.75A.75.75 0 0 1 1.75 2h12.5a.75.75 0 0 1 0 1.5H1.75A.75.75 0 0 1 1 2.75Zm0 5A.75.75 0 0 1 1.75 7h12.5a.75.75 0 0 1 0 1.5H1.75A.75.75 0 0 1 1 7.75ZM1.75 12h12.5a.75.75 0 0 1 0 1.5H1.75a.75.75 0 0 1 0-1.5Z"></path></svg> を選択し、**<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-codespaces" aria-label="codespaces" role="img"><path d="M0 11.25c0-.966.784-1.75 1.75-1.75h12.5c.966 0 1.75.784 1.75 1.75v3A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm2-9.5C2 .784 2.784 0 3.75 0h8.5C13.216 0 14 .784 14 1.75v5a1.75 1.75 0 0 1-1.75 1.75h-8.5A1.75 1.75 0 0 1 2 6.75Zm1.75-.25a.25.25 0 0 0-.25.25v5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5a.25.25 0 0 0-.25-.25Zm-2 9.5a.25.25 0 0 0-.25.25v3c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-3a.25.25 0 0 0-.25-.25Z"></path><path d="M7 12.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path></svg> コードスペース**をクリックして、[github.com/codespaces](https://github.com/codespaces) の \[Your codespaces] ページに移動します。 または、個々のリポジトリでは、**\[<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-code" aria-label="code" role="img"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg> Code]** メニューをクリックしてください。

2. エクスポートする元の codespace の右側にある省略記号 ( **...** ) をクリックします。

3. ```
          **<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-git-branch" aria-label="git-branch" role="img"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> 変更をブランチにエクスポートする** または **<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-git-branch" aria-label="git-branch" role="img"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> 変更をフォークにエクスポートする** を選択します。
   ```

   ![codespace 一覧とその 1 つのドロップダウン メニューのスクリーンショット。\[ブランチへの変更をエクスポートする\] オプションが表示されています。](/assets/images/help/codespaces/export-changes-to-a-branch.png)

4. ダイアログ ボックス内で、**\[分岐の作成]** または **\[フォークの作成]** をクリックします。

新しいブランチの名前は codespace の永続名となり、文字列 `codespace-` が先頭に付きます (例: `codespace-ideal-space-engine-w5vg5ww5p793g7g9`)。