Git Sync
1. Getting Started

Installation

Installation

Welcome to the Git Sync (tokomono/git-sync) documentation! Git Sync is a Laravel package designed to synchronize runtime changes—such as AI Suite workflow definitions, agent prompts, roles, and configuration overrides made in staging or test environments—directly back to your Git repository by automatically creating branches, committing updated PHP/JSON files, and opening Pull Requests on GitHub or Bitbucket.

Requirements

Before installing Git Sync, ensure your environment meets the following requirements:

  • PHP 8.2 or higher (PHP 8.3+ recommended)
  • Laravel 11.x / 12.x / 13.x
  • Composer 2.x
  • A GitHub or Bitbucket repository with API token / App Password access

Installing via Composer

Install the package via Composer in your Laravel project:

composer require tokomono/git-sync

Laravel's package auto-discovery automatically registers Tokomono\GitSync\Providers\GitSyncServiceProvider.

Publishing Configuration & Running Migrations

Publish the config/git-sync.php configuration file and run the database migrations to create the git_sync_pull_requests table:

php artisan vendor:publish --tag="git-sync-config"
php artisan migrate

Database Schema (git_sync_pull_requests)

Running php artisan migrate creates the git_sync_pull_requests table, which tracks all branches and Pull Requests created by Git Sync:

Column Type Description
id bigint (PK) Auto-incrementing primary key
target_branch string Base branch the PR targets (e.g. main, develop, staging)
source_branch string Newly created feature/sync branch containing the committed changes
title string Title of the Pull Request
provider string Git provider identifier (github or bitbucket)
pr_url string (nullable) Full HTML URL to the created Pull Request on GitHub or Bitbucket
status enum Pull Request lifecycle state: 'open', 'merged', 'closed', or 'failed' (defaults to 'open')
created_at / updated_at timestamp Timestamps