Freestyle Docs

Freestyle / Docs

GitHub Sync

Synchronize Freestyle Git repositories with GitHub repositories.

Freestyle can synchronize repositories between Freestyle Git and GitHub. Use this when your product stores source code in Freestyle but users still need visibility or workflows in GitHub.

How Sync Works

Freestyle uses GitHub Apps for repository-specific access. When code is pushed to either side, Freestyle syncs changes to the other side while avoiding destructive force pushes.

Freestyle syncs:

  • Branch creation and updates
  • Commit history
  • Tags
  • Branch deletions

If branches diverge, Freestyle avoids overwriting data. Resolve conflicts manually in either repository, then sync resumes.

Create Or Connect A GitHub App

  1. Open the Freestyle Dashboard.
  2. Go to Git > Sync.
  3. Create a GitHub App or connect an existing app.
  4. Install the app on the GitHub repositories you want to sync.

For app builders, send users to your GitHub App installation URL so they can authorize repository access.

  1. Go to Git > Repositories.
  2. Select the Freestyle repository.
  3. Click Configure GitHub Sync.
  4. Choose the GitHub repository.
  5. Save the configuration.
import { freestyle } from "freestyle";

const { repo } = await freestyle.git.repos.create();

await repo.githubSync.enable({
  githubRepoName: "owner/repo",
});

const syncConfig = await repo.githubSync.get();
console.log(syncConfig?.githubRepoName);

await repo.githubSync.disable();

Safety Rules

  • Freestyle does not force-push to resolve conflicts.
  • GitHub App permissions are scoped to installed repositories.
  • Repository sync should be configured only after the GitHub App has access to the target repository.
esc