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

# GitHub

> Connect Ardor to GitHub for external collaboration, local development, and repository ownership.

<img src="https://mintcdn.com/ardor/sf-RwXk0pWSNetwj/docs/integrations/images/Integration.png?fit=max&auto=format&n=sf-RwXk0pWSNetwj&q=85&s=6345d9dc09a74ba583d63ee7c14f23e1" alt="GitHub Integration" width="2845" height="1398" data-path="docs/integrations/images/Integration.png" />

## Overview

Connect your GitHub account to keep full ownership of your code. When Cerebrum builds services for you, the code lives in your repositories — you control it, you own it.

<Note>
  **New to GitHub?** It's a cloud platform for storing and versioning code. When you link a service to GitHub, the repo becomes the source of truth for that service's code.
</Note>

## Why Connect GitHub

<CardGroup cols="2">
  <Card title="Own your code" icon="shield-check">
    All code Cerebrum creates goes to your GitHub. No lock-in, full ownership.
  </Card>

  <Card title="Work your way" icon="laptop-code">
    Clone repos, use your favorite IDE, collaborate with your team via PRs.
  </Card>

  <Card title="Import existing projects" icon="folder-open">
    Already have code on GitHub? Create Ardor services directly from your repos.
  </Card>

  <Card title="Git workflow" icon="rotate">
    Push, review, and collaborate in GitHub while Ardor keeps the service connected to the repository.
  </Card>
</CardGroup>

<Tip>
  **Recommended:** Connect GitHub early. It's easier to start with GitHub integration than to export later.
</Tip>

## Before You Connect

<AccordionGroup>
  <Accordion title="GitHub account required">
    You need a GitHub account or organization where Ardor can access repositories.
  </Accordion>

  <Accordion title="Repos connect to services, not solutions">
    Each service can have its own GitHub repo. A solution may contain multiple services with different repos.
  </Accordion>

  <Accordion title="One repo per service">
    A service points to a single Git repository. You can't attach multiple repos to one service.
  </Accordion>

  <Accordion title="Don't rename or move repos">
    If you rename, delete, or transfer the GitHub repo outside Ardor, syncing and deployments will break.
  </Accordion>

  <Accordion title="Export creates a new repo">
    When exporting from Ardor to GitHub, a new repository is always created to avoid overwriting existing code.
  </Accordion>
</AccordionGroup>

## Setup Process

<Steps>
  <Step title="Connect GitHub Account">
    Link your GitHub identity via OAuth
  </Step>

  <Step title="Install Ardor GitHub App">
    Grant Ardor permission to read/create repos
  </Step>

  <Step title="Create or Export Services">
    Import from GitHub or export existing Ardor services
  </Step>
</Steps>

<Warning>
  Only workspace admins can manage GitHub integration.
</Warning>

## Setup

### Step 1: Connect Your GitHub Account

1. Go to **Workspace Settings → General → Integrations → GitHub**
2. Click **Connect GitHub**
3. Authorize Ardor to access your GitHub account

<Note>
  Nothing syncs yet — this step just verifies your GitHub identity.
</Note>

### Step 2: Install the Ardor GitHub App

After connecting your account, install the GitHub App to grant Ardor repo access:

1. Choose where to install — personal account or organization
2. Select **All repositories** or specific ones
3. Click **Authorize Ardor**

After installation, Ardor can create repos and read code.

## Using GitHub with Ardor

Once setup is complete, you have two ways to use GitHub with your services:

<Card title="Import from GitHub" icon="github" href="/docs/services/create_service/import-from-github">
  Create an Ardor service from an existing GitHub repository.
</Card>

### Scenario B: Export to GitHub

**Use this when:** Cerebrum built a service for you in Ardor, and you want to move the code to your own GitHub account.

<img src="https://mintcdn.com/ardor/sf-RwXk0pWSNetwj/docs/integrations/images/Step3B_export_to_Git.png?fit=max&auto=format&n=sf-RwXk0pWSNetwj&q=85&s=04ef190956b798761dc32cb5a8339300" alt="Export to GitHub" width="1800" height="510" data-path="docs/integrations/images/Step3B_export_to_Git.png" />

1. Open the service
2. Go to **Settings → General**
3. Click **Convert to GitHub**
4. Confirm the transfer

Ardor creates a new GitHub repo, pushes your full commit history, and links the service to that repo going forward.

<Warning>
  Export always creates a new repository — you can't select an existing one.
</Warning>

## Managing GitHub-Linked Services

Services linked to GitHub:

* Show repository details in the service settings
* Sync commits automatically

These services can't be "unlinked" — GitHub is their source of truth.

## Disconnect GitHub

To revoke Ardor's access:

1. Go to **GitHub → Settings → Applications → Installed GitHub Apps**
2. Find **Ardor** and click **Revoke Access**

<Warning>
  After revoking, Ardor can't read or create repos. Git-backed services stop syncing until you reconnect.
</Warning>
