> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ironoctopus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect GitHub

> Connect your own GitHub account or organization so you can export code to your repositories and import branches from them.

Connecting GitHub lets you copy code between Iron Octopus and repositories you own. Iron Octopus always builds in the [repository it manages](https://docs.ironoctopus.ai/code/where-your-code-lives.md). GitHub is how you take that code out, or bring existing code in.

## What connecting does

You install the dedicated **IronOctopus GitHub App** on your GitHub account or organization, limited to the private repositories you choose. With it connected, you can:

* **Export** a feature's code to a branch in one of those repositories.
* **Import** a branch from one of those repositories into a feature.

This connection is separate from the GitHub service Iron Octopus uses internally. It only reaches the repositories you selected.

## Connect

You need to be a workspace Owner or Admin, and able to install GitHub Apps on the GitHub account that owns the repositories.

**1. Open Integrations**

Go to Workspace settings › **Integrations**, and find **Customer GitHub repositories**.

**2. Name the GitHub account**

Under **GitHub account type**, choose **Personal account** or **GitHub organization**, then enter the **GitHub username** or organization name that owns the repositories.

**3. Install the app on GitHub**

Click **Connect GitHub**. GitHub opens and checks that you have access. Choose **Only select repositories**, pick the repositories Iron Octopus may use, and install.

**4. Check it's connected**

Back in **Integrations**, the installation is listed under **Customer GitHub repositories**.

You can connect more than one account or organization.

## Use it

| To | Go to |
| - | - |
| Export a feature's code to your repository | The feature › **Export** › **Export to GitHub**. See [export the code](https://docs.ironoctopus.ai/build/feature-history.md#export-the-code). |
| Import a branch from your repository | The feature › **Export** › **External GitHub branch transfer**. See [import a branch](https://docs.ironoctopus.ai/build/feature-history.md#import-a-branch). |

## Change or disconnect

* **To add or remove repositories**, change the app's repository access in your GitHub settings.
* **To disconnect**, click **Disconnect** next to the installation in **Integrations**. Exports and imports through it stop. Code you already exported stays in your repositories.

## If something goes wrong

| You see | What to do |
| - | - |
| **Could not start GitHub installation** | Check the account type and name, and that you can install apps on that account. |
| **Connect GitHub in Workspace Settings → Integrations to export code.** | No connection exists yet. Connect GitHub first. |
| A repository is missing from the export list | Give the app access to it in your GitHub settings. |
| An export updated a branch and CI ran | Exporting to a branch can trigger workflows you've set up in GitHub. Export to a new branch to avoid this. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.