# Keep working when GitHub is down

Keep Sailfork as a second remote with one git push, choose a push or pull mirror, and know what to do with CI and pull requests during a GitHub outage.

A second remote means a GitHub outage stops nothing: your code is already somewhere else, current, and writable. To keep both copies in step every day, not only during an outage, see [Use Sailfork alongside GitHub](https://sailfork.com/docs/github-alongside). Sailfork holds the same git history over HTTPS and SSH, so you can push, open pull requests and run CI here while GitHub is out.

## Push to both with one command

Create the repository on Sailfork, then add its address as a second push address of `origin`. Sign in first with `sailfork auth login`, so git needs no password. See [Git over HTTPS and SSH](https://sailfork.com/docs/git-access).

```sh
sailfork repo create <repo>
git remote set-url --add --push origin https://github.com/<owner>/<repo>.git
git remote set-url --add --push origin https://git.sailfork.com/<owner>/<repo>.git
git push --all origin
git push --tags origin
```

Over SSH, use the SSH addresses of both hosts:

```sh
git remote set-url --add --push origin git@github.com:<owner>/<repo>.git
git remote set-url --add --push origin ssh://git@git.sailfork.com:2222/<owner>/<repo>.git
```

The first `--push` address replaces the default one, so add GitHub back as shown. `git remote -v` then lists both under `(push)`, and `git push` sends to each in turn. Fetch and pull still come from GitHub.

When GitHub is down, that push fails on GitHub and succeeds on Sailfork, and git exits with an error. Skip the broken one by pushing to Sailfork alone. Name it as its own remote:

```sh
git remote add sailfork https://git.sailfork.com/<owner>/<repo>.git
git push sailfork
git switch -c fix/login
git push -u sailfork fix/login
```

Push the same way to a teammate's clone: each person adds the remote once.

## Mirrors that exist today

A [mirror](https://sailfork.com/docs/mirrors) keeps a repository in step with a copy on another host, with no change to how you push. Mirrors copy git only: branches and tags. Issues, pull requests, reviews, CI runs and secrets stay on the side where you made them, except that a pull mirror from GitHub also brings over pull requests, issues and releases, read-only.

| You want | Use | How it syncs |
| --- | --- | --- |
| Sailfork is the main home, GitHub is the copy | A push mirror to GitHub | Every push to Sailfork goes to GitHub about 10 seconds later. A failed push is retried. |
| Both stay writable, kept in step | A push mirror to GitHub with **Take pushes made there** | As above, and pushes made on GitHub come back. See [Use Sailfork alongside GitHub](https://sailfork.com/docs/github-alongside). |
| GitHub is the main home, Sailfork is the backup | A pull mirror from GitHub | A GitHub webhook fetches at once. Without it, Sailfork checks every 10 minutes. |
| Both stay writable, no mirror | The two push addresses above | You push to both. |

Set up either one from the repository's **Mirrors** tab, or from the terminal for a whole move with `sailfork migrate start <owner>/<repo> --after mirror` (push mirror back to GitHub) or `--after pull` (pull mirror from GitHub). See [Mirrors](https://sailfork.com/docs/mirrors) and [Move from GitHub](https://sailfork.com/docs/migrate). There is no mirror command in the CLI; the routes are in [the REST API](https://sailfork.com/docs/api-repositories#mirrors).

> [!IMPORTANT]
> A pull mirror is read-only: a push to it fails with `this repository is a mirror of <remote> and is read-only: push there instead`. That is no use while GitHub is down. Remove the mirror (**Remove mirror** on its row) to make the repository writable. What it fetched stays. To work during outages without that step, use the two push addresses, or make Sailfork the main home with a push mirror.

A commit pushed straight to GitHub is copied back only by a push mirror that takes pushes made there. Otherwise the mirror stops on that branch and shows it as held, instead of overwriting anything. See [When a mirror stops](https://sailfork.com/docs/mirrors#when-a-mirror-stops).

## During an outage

1. **Push to Sailfork.** Use the `sailfork` remote above, or `git push` with the dual address once GitHub answers again.
2. **Run CI on Sailfork.** Sailfork runs the GitHub Actions files already in `.github/workflows/`, so a push starts the same workflows. Watch one with `sailfork ci list` and `sailfork ci watch <run id>`. See [CI](https://sailfork.com/docs/ci).
3. **Open pull requests on Sailfork.** From the branch you pushed, run `sailfork pr create --fill`. Reviews, comments and merges happen here. See [Pull requests](https://sailfork.com/docs/pull-requests).

## When GitHub is back

Pull requests, reviews and issues you made on Sailfork stay on Sailfork. Nothing syncs them to GitHub, and there is no two-way sync of issues or pull requests today.

- **Dual push.** Merge on Sailfork, pull the result, and run `git push origin`. GitHub gets the same commits and the hashes match.
- **Push mirror.** GitHub catches up on its own after your next push, or choose **Sync now** on the mirror's row. One that takes pushes made there also brings back what was pushed to GitHub meanwhile.
- **Someone pushed to GitHub meanwhile.** The two sides now differ. Fetch GitHub, merge or rebase in a clone, and push the result to both. A push mirror shows the branch as held until you choose **Import as branch** or **Overwrite this ref**.
- **A pull mirror you removed.** Add it again if you want Sailfork to follow GitHub, after pushing what only Sailfork holds. A pull mirror replaces branches that differ from the remote, and asks you to confirm first.

## Use Sailfork from VS Code and JetBrains

Git works unchanged. The Git view in VS Code and the Git tool window in JetBrains IDEs use your `git`, so the remotes above, clone, push and pull need no plugin. Sign in once with `sailfork auth login` so the credential helper answers for `git.sailfork.com`.

To let each IDE's AI assistant read issues and pull requests, edit in [caissons](https://sailfork.com/docs/caissons) and read CI, connect the [MCP server](https://sailfork.com/docs/mcp). Both IDEs open a browser to approve the connection, so no token goes in a file.

### VS Code

Create `.vscode/mcp.json` in the workspace, or run **MCP: Open User Configuration** from the Command Palette for all workspaces. See [VS Code MCP configuration](https://code.visualstudio.com/docs/agents/reference/mcp-configuration).

```json
{
  "servers": {
    "sailfork": {
      "type": "http",
      "url": "https://sailfork.com/mcp"
    }
  }
}
```

### JetBrains IDEs

Open **Settings**, **Tools**, **AI Assistant**, **Model Context Protocol (MCP)**, choose **Add**, and paste the entry. Pick whether it applies to every project or this one. See [JetBrains MCP settings](https://www.jetbrains.com/help/ai-assistant/mcp.html).

```json
{
  "mcpServers": {
    "sailfork": {
      "url": "https://sailfork.com/mcp"
    }
  }
}
```

### With the CLI instead of a browser

If your IDE cannot complete the browser approval, run the local server, which uses the login of `sailfork auth login`. In VS Code:

```json
{
  "servers": {
    "sailfork": {
      "type": "stdio",
      "command": "sailfork",
      "args": ["mcp"]
    }
  }
}
```

JetBrains takes the same `command` and `args` under `mcpServers`. Add `"--read-only"` to `args` for tools that change nothing. See [MCP server](https://sailfork.com/docs/mcp#on-this-machine-with-the-cli).

---

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