Ploy Code Sync

Connect a GitHub repository to your Ploy Site and collaborate with your dev team directly in code.

This integration is specific to Ploy Site — it syncs the underlying codebase of a single site with a GitHub repository. It is not a workspace-level or account-level integration. Ploy's Agent's edits commit to your repo, and any commits your team pushes flow back into the Ploy sandbox when you click Sync from GitHub in your Site Settings. Each one of your marketing sites lives in code — exactly where your engineers already work.


How the Integration Works

  1. Connect — For each workspace, its Owners and Admins can Authorize Ploy's GitHub App. This enables each Site in the workspace to make available a repo url such as git@github.com:ployspace/your_unique_site_name_slug.git.
  2. Sync — Ploy initiates the repo in your sandbox during site creation.
  3. Collaborate — Ploy's Agent commits changes to branches, opens PRs, and can also pull your team's external updates from the sync'd GitHub repo.

Tip: Every commit Ploy's Agent makes includes a clear message so your team can review changes like any other PR.

Tip: Using git sync is an Advanced feature. If Ploy's site editor and your external code changes conflict in the branch, you can ask Ploy's Agent to resolve the conflicts, but we also advise the usual developer best practices regarding source control collaboration.


Connecting a Repository

  1. Open Workspace Settings in the Ploy dashboard.
  2. Click Connect GitHub and authorize the Ploy GitHub App from the @ployspace org

Permissions

The Ploy GitHub App requests limited access to:

  • Create branch or tag
  • Push to the repo

Inviting more GitHub users to collaborate

  • Go to Site Settings → Developer
  • Find the Source Control - Collaborators section
  • Type in a literal GitHub username (not email) to invite that user
  • Collaborator access can be removed by admins and owners at any time

Connecting to GitHub third-party integrations

Ploy-managed repositories don't support third-party GitHub integrations for security reasons. If you need to connect one, create a mirror of your repository in your own GitHub account (or another Git host) and set up the integration there. You'll need to set up a sync workflow to keep the mirror in step with your Ploy repo.


Syncing Changes

Pushing from Ploy

When Ploy's Agent edits your site, changes are committed to your connected branch. You can opt to:

  • git pull on your local copy then continue the work
  • Create a new git remote and sync it to your own server then follow your team's code review workflows. Sync back to the github.com/ployspace remote when you want to update the live Ploy preview.

Pulling from GitHub

If your team pushes commits to the repo (hotfixes, design tweaks, new components), Ploy pulls them into the sandbox automatically. Ask Ploy's Agent to "Sync from GitHub" any time you want to force a refresh.

Note: Ploy uses git pull --rebase --autostash so local sandbox edits aren't lost during a sync.


Disconnecting GitHub Integration

To remove git push access to the Ploy site:

  1. You must be an Admin or Owner role in the Workspace
  2. Open Workspace Settings → Integrations.
  3. Click the trash icon to delete the connection.
  4. Confirm — your site's code stays intact, but future edits no longer sync.
  5. You can reconnect at any time.

Troubleshooting

  • Push rejected — Usually means the remote has new commits. Perform a git pull --rebase --autostash in your local copy, resolve conflicts, then try git push again.
  • Permission denied — Workspace Admins and Owners can try to re-authorize the GitHub App and confirm the GitHub username attempting to pull or push the repo is in the Site → Developer → Source Control → Collaborator list.
  • Merge conflicts — Resolve in GitHub, then ask Ploy's Agent to pull the resolved branch.

What's Next?