# Use Sailfork alongside GitHub

Keep a repository on Sailfork and GitHub at once with a two-way mirror, so contributors on GitHub and your team on Sailfork both push, and pick the setup that fits.

You don't have to leave GitHub to use Sailfork. Keep the repository on both: your team works on Sailfork, and the GitHub copy stays current for the people who find the project there.

## Pick a setup

| You want | Use | Who pushes where |
| --- | --- | --- |
| Sailfork is home, GitHub stays current and open to pushes | A push mirror to GitHub with **Take pushes made there** on | Anyone, on either side. Sailfork sends its pushes to GitHub, and pushes made on GitHub come back. |
| Sailfork is home, GitHub is a read-only copy | A push mirror to GitHub | Push to Sailfork. A commit pushed on GitHub holds that branch until you resolve it. |
| GitHub is home, Sailfork is a backup | A pull mirror from GitHub | Push to GitHub. The Sailfork copy is read-only. |
| No mirror at all | Two push addresses on `origin` | You push to both yourself. See [Keep working when GitHub is down](https://sailfork.com/docs/github-outage-backup). |

The first row is the two-way mirror, and the rest of this page sets it up.

## Set up a two-way mirror

1. Get the repository onto Sailfork. Move it with [Move from GitHub](https://sailfork.com/docs/migrate), or create it and push. A move can add the mirror for you: `sailfork migrate start <owner>/<repo> --after mirror`.
2. Open the repository's **Mirrors** tab at `https://sailfork.com/<owner>/<repo>/mirrors`. Under **Copies elsewhere**, choose **Add mirror** and pick GitHub. Connect your GitHub account and install the Sailfork app if the form asks (see [Connect GitHub](https://sailfork.com/docs/mirrors#connect-github)).
3. Pick the GitHub repository, and what to send. **Everything** keeps both sides the same.
4. Turn on **Take pushes made there**, and choose **Start mirroring**.

An existing push mirror turns two-way from its row: open what it sends, turn on **Take pushes made there**, and choose **Save and push**.

## What syncs

| Change | Made on Sailfork | Made on GitHub |
| --- | --- | --- |
| New commits on a branch | Sent to GitHub about 10 seconds after the push. | Taken into Sailfork when GitHub's push webhook arrives, or within 10 minutes. |
| A new branch or tag | Sent. | Taken. |
| A deleted branch or tag | Deleted there only with **Delete there what you delete here**. | Stays on Sailfork. |
| A moved tag | Sent, replacing the one Sailfork sent before. | Held as diverged on the mirror's row. |
| A force-push | Held as diverged when GitHub has commits Sailfork's new value drops. | Held as diverged. Nothing is overwritten. |
| The same branch changed on both sides | Held as diverged on the mirror's row. | Same. |

Only what the mirror sends comes back: with the default branch only, a branch created on GitHub stays there.

A push taken from GitHub counts as a push on Sailfork. CI runs, webhooks fire, and the activity feed shows it, attributed to the person who set up the mirror. Branch protection on Sailfork does not apply to it, because it already landed on GitHub. Protect the same branches on GitHub too.

When a branch is held, open the row and choose **Import as branch** to bring GitHub's commits into a branch you can merge, or **Overwrite this ref** to replace GitHub's. See [When a mirror stops](https://sailfork.com/docs/mirrors#when-a-mirror-stops).

## What stays on one side

Pull requests, issues, reviews, releases, CI runs and settings are not mirrored. Each stays where it was opened. Contributors on GitHub open pull requests there, and when you merge one on GitHub, the merge comes back to Sailfork as a push. Pull requests on Sailfork are merged on Sailfork, and the result goes out to GitHub.

## During a GitHub outage

Keep working on Sailfork: push, open pull requests and run CI there. The mirror retries until GitHub answers again, then sends everything it missed. See [Keep working when GitHub is down](https://sailfork.com/docs/github-outage-backup).

---

Every docs page: https://sailfork.com/llms.txt
