Collaboratively Synchronize your Grav Pages hosted on GitHub, BitBucket or GitLab
PHP HTML JavaScript CSS Shell
Clone or download
Permalink
Failed to load latest commit information.
app Added support for new Admin Navigation Tray Aug 15, 2017
classes Git add --all for git versions < 2.0 (#49) Jun 29, 2017
cli CLI: Added status command to check config and git (#52) Jun 29, 2017
css-compiled Added more documentation and description about the support of 2FA and… Feb 19, 2017
images Changed font-face for generic git logo. Recompiled CSS Feb 18, 2017
js Added support for new Admin Navigation Tray Aug 15, 2017
scss Added more documentation and description about the support of 2FA and… Feb 19, 2017
templates Typo and sentence-structure. (#50) Jun 29, 2017
vendor Git password will now get encrypted and won't load in admin Jan 17, 2017
.eslintrc Setup and implementation for the wizard Nov 10, 2016
.gitignore Better way to retrieve the current git version installed Jan 11, 2017
CHANGELOG.md Preparing for 1.0.4 release Aug 16, 2017
LICENSE Updated License Nov 7, 2016
README.md Update installation part (#74) Oct 31, 2017
blueprints.yaml Preparing for 1.0.4 release Aug 16, 2017
composer.json Git password will now get encrypted and won't load in admin Jan 17, 2017
composer.lock Git password will now get encrypted and won't load in admin Jan 17, 2017
git-sync.php Added support for new Admin Navigation Tray Aug 15, 2017
git-sync.yaml Setup and implementation for the wizard Nov 10, 2016
gosass.sh Setup and implementation for the wizard Nov 10, 2016
package.json Updated dependencies Jan 25, 2017
watch.sh Moved CSS files to css-compiled and using `wellington` for compilation Jan 12, 2017
webpack.conf.js documented support for generic git - issue:7 (#22) Feb 18, 2017
wizard.png Updated README Feb 19, 2017
yarn.lock Updated dependencies Jan 25, 2017

README.md

Git Sync is a Plugin for Grav CMS that allows to seamlessly synchronize a Git repository with your Grav site, and vice-versa.

Git Sync captures any change that you make on your site and instantly updates your git repository. In the same way, Git Sync supports webhooks, allowing to automatically synchronize your site if the repository changes.

Thanks to this powerful bi-directional flow, Git Sync can now turn your site into a collaborative environment where the source of truth is always your git repository and unlimited collaborators and sites can share and contribute to the same content.

Videos: Setup and Demo

Up and Running in 2 mins 2-way Sync Demonstration
Up and Running in 2 mins 2-way Sync Demonstration

Installation using the GPM (Grav Package Manager)

bin/gpm install git-sync

Features

  • Easy step-by-step Wizard setup will guide you through a detailed process for setting things up
  • Supported hosting services: GitHub, BitBucket, GitLab as well as any self-hosted and git service with webhooks support.
  • Private repository
  • 2FA (Two-Factor Authentication) and Access Token support
  • Webhooks support allow for automatic synchronization from the Git Repository
  • Automatically handles simple merges behind the scenes
  • Easy one-click button to reset your local changes and restores it to the actual state of the git repository
  • Easy one-click button to manually synchronize
  • Customize the Committer Name, choose between Git User, GitSync Commiter Name, Grav User Name and Grav user Fullname
  • With the built-in Form Process action gitsync, you can trigger the synchronization anytime someone submits a post.
  • Any 3rd party plugin can integrate with Git Sync and trigger the synchronization through the gitsync event.
  • Built-in CLI command to automate synchronizations.

Command Line Interface

Git Sync comes with a CLI that allows to run synchronizations right within your terminal. This feature is extremely useful in case you'd like to run an autonomous periodic crontab job to synchronize with your repository.

To execute the command simply run:

bin/plugin git-sync sync

Requirements

In order for the plugin to work, the server needs to run git 1.7.1 and above. The PHP exec() function also has to be enabled.

Sponsored by

This plugin could not have been realized without the sponsorship of Hibbitts Design and the development of Trilby Media.