# Connect a GitHub repository

> Install the Stolon GitHub App: every pull request gets its own branch of your database, a check showing what merging it would change, and its data merged when the pull request merges.

Source: https://stolondb.com/guides/github/ · Page title: Connect a GitHub repository — Stolon

Every pull request gets its own branch of your database. When the pull request merges, so does its data.

## 1. Install the App

Open your database in [the console](https://console.stolondb.com/app) and choose **Connect a GitHub repository**. GitHub asks which repository; pick one and you come back linked.

## 2. Open a pull request

Its branch is `pr-<number>`, forked from `main`. Point the pull request's preview or tests at it:

```text
postgresql://app:<password>@db.stolondb.com/acme.pr-42
```

The pull request gets one comment naming its branch, and a check, **stolon: data**, showing what merging it would change in the database, with any conflict named by table, row and column.

## 3. Merge it

Merging the pull request merges its branch into `main`. Only what the check showed lands: a branch written to after the check is not merged.

## Settings

- **Branch from and merge into**: `main`, or any branch.
- **When a pull request merges**: merge its data, or leave it.
- **Pull requests into**: the repository's default branch, or one you name.
- **Drop a pull request's branch when it closes.**

No credential is ever posted to GitHub, so public repositories are safe to link.
