viovenia/statamic-git-sync
Statamic Git Sync keeps your Statamic site's content and configuration in sync with a Git repository, so changes are versioned, trackable, and easy to deploy across environments. A lightweight addon for teams that want Git-backed workflows without manual commits.
Install the addon with Composer, publish its config, and run php artisan statamic:git-sync:doctor before enabling anything. The doctor is the first place to look: it checks the git binary, repository state, identity, branch, remote, content paths, pull-request setup, notifications, history file, cache lock support, queue driver and safety net, and exits non-zero on problems.
A sensible first configuration is narrow: point the package at the Statamic content paths you actually want versioned, enable syncing for entries only, and configure the commit author fallback for console/scheduled runs. Then edit an entry in the control panel and confirm that one debounced commit appears rather than one commit per save.
Add statamic:git-sync to the scheduler early. The event path handles normal editing, but the scheduled run is the safety net for flushed caches, stopped queue workers and missed events.
First real use case: automatic Git history for editorial content changes on Statamic Solo, with the control panel user credited as commit author and a “Recent content syncs” widget for visibility.
doctor warns you.statamic:git-sync command as part of the deployment/operations contract. It closes the gap when an event is missed, so a cleared cache or stopped worker costs a delay rather than a lost commit.{summary}, {count}, {user}, {date} and {files}. Keep the Committed-by: statamic-git-sync trailer intact: it is the loop guard.strategy => 'pull-request'. The package pushes the current branch and opens or reuses a pull request against the configured base branch, which is useful when content changes need editorial or client approval before landing on the main branch.doctor to reject a head/base branch setup that cannot work.cache:clear, which makes it more useful than cache-backed status during deploys.SyncStarted, SyncCompleted, SyncSkipped, SyncFailed, ConflictDetected and PullRequestOpened when integrating with external monitoring or messaging. The events carry typed DTOs.statamic:git-sync:doctor to CI or deploy gates. Its non-zero exit status is designed for exactly that.doctor is not optional. Run it after config changes and in deploys; it is the fastest way to catch identity, remote, branch, cache-lock and pull-request misconfiguration.doctor should be telling you why.git commit --only, so files staged by hand stay staged and are not swept into an automated commit. Do not expect it to act like git add -A.SyncFailed and ConflictDetected.Committed-by: statamic-git-sync trailer from templates. It prevents automated sync commits from feeding back into the sync loop.SyncManager::sync() never throws into a control panel save request; the subscriber only queues. Do not build UI error handling around exceptions from content saves. Use events, notifications and the widget/history instead.How can I help you explore Laravel packages today?