Skip to main content

How to use Git Sync in AI Studio

Learn how to connect GitHub to AI Studio in ZipLeads, sync your project code automatically, manage branches, review changes and resolve sync conflicts.

M
Written by Matt Phillips

Git Sync in ZipLeads AI Studio connects your projects to Git repositories. Code changes then sync between AI Studio and your external development tools. You can work with tools such as Cursor, Claude Code, Codex, GitHub Copilot and Gemini CLI while keeping your project versions up to date. Automatic syncing, version tracking and branch management make it easier to build projects without moving code around by hand.


What is Git Sync in AI Studio?

Git Sync is a two-way integration that keeps code changes in sync between AI Studio and a connected Git repository. When you connect a GitHub account, AI Studio automatically creates a private repository for your project and pushes its first version to GitHub.

Git Sync lets you:

  • Sync changes automatically: Push saved AI Studio versions to GitHub and pull external commits back into AI Studio.

  • Work with external development tools: Edit project code outside AI Studio without moving files by hand.

  • Track changes: Keep project versions and Git commit history.

  • Review updates: Generate new preview builds after pulling in external changes.

  • Manage development: Switch branches, monitor sync activity and resolve conflicts.

Git Sync supports React (Vite) and TanStack Start projects, including dependency and lockfile changes. Images, fonts and other binary files are kept during syncing, although the AI Studio Code Editor can't preview binary files.

Git Sync is optional. Projects without a Git connection keep working as normal.

Note: Git Sync uses Git, which is supported by GitHub and other repository providers. This article covers GitHub. Support for other Git-based providers, including privately hosted repositories, may vary.


How to set up Git Sync with GitHub in AI Studio

Connecting GitHub creates a private repository for your project and turns on automatic syncing. You can connect a personal account or an organisation, and choose who can use the connection.

Before you begin: Make sure your user has the Manage Git & download code permission under Settings → Team → Permissions → AI Studio. This permission is turned on by default for user roles in your account.

  1. Open your ZipLeads account, go to AI Studio and select your project.

  2. Click More → Git, then select GitHub.

  3. Click + Add connection to connect a new GitHub account. If your account is already listed, click Connect.

  4. Choose My GitHub account or Organization, then choose who can use the connection:

    • Only me: Available only to you.

    • Sub-account: Available to other users in your account, depending on their permissions.

  5. Click Continue on GitHub.

  6. Install and authorise the ZipLeads app on GitHub. Complete any verification GitHub asks for. Organisation members may need approval from an administrator.

  7. Go back to AI Studio and let the connection finish. AI Studio creates a private repository, pushes the first version and connects to the main branch.

  8. Check that Automatic Push and Automatic Pull are turned on. Both are on by default.


Automatic push and pull syncing

Git Sync automatically keeps your AI Studio project and GitHub repository in sync. Automatic Push and Automatic Pull are both on by default, and you can turn each one off separately.

  • Automatic Push: Every saved AI Studio version is pushed to GitHub. This includes AI-generated changes, code edits, visual edits and restored versions. Commits keep their original history and are attributed to a ZipLeads system account rather than your personal GitHub identity.

  • Automatic Pull: New commits on the connected GitHub branch are automatically pulled into AI Studio. Each commit creates a new project version, shows the changed files in a chat card and generates an updated preview.

When the preview is ready, click Refresh preview to see the latest changes. You can also use Push now or Pull now in More → Git to sync by hand, even when automatic syncing is turned off.

Sync conflicts: If both GitHub and AI Studio have new commits, the branch is marked as diverged in Git settings. Select Review and resolve, then choose one of these:

  • Force push: Keeps the AI Studio version. This can overwrite diverged GitHub commits.

  • New branch: Pushes the AI Studio changes to a new branch, so both versions are kept.

Note: Git Sync scans outgoing changes for sensitive credentials. Recognised secrets block the push. Credentials that look hardcoded trigger a warning.


Managing Git Sync in AI Studio

Once Git Sync is connected, you can switch branches, review sync history and manage your GitHub connection from your project's Git settings.

Switch or create a branch

Git Sync uses the main branch by default, but you can work with other branches when you need to.

  1. Open your AI Studio project and go to More → Git.

  2. Find the branch selector and choose an existing branch, or type a new branch name.

  3. Confirm your choice. If the branch doesn't exist yet, AI Studio creates it on the next push.

Only the selected branch receives incoming commits from GitHub. Changes on other branches aren't pulled in until you switch to them.

View sync history

Sync History helps you check whether changes moved successfully between AI Studio and GitHub.

  1. Open More → Git in your AI Studio project.

  2. Select Sync History to see recent activity, including pushes, pulls, commit records and sync errors.

You can also see total syncs, the success rate and links to individual commits on GitHub. Failed operations include details explaining what went wrong.

Disconnect or reconnect GitHub

You can manage your GitHub connection from More → Git.

Use Disconnect to disconnect the project from GitHub. You can also reconnect an account when its authorisation needs renewing. When you reconnect a project that was connected before, AI Studio can reuse its existing repository instead of creating a new one. It won't force-push changes automatically.

Did this answer your question?