Git-Sync 2.0

A big update that adds more power and control

4 mins

Today, the biggest update so far to the Git Sync Plugin has been released, and what a release it is! Two of the most requested features have been added - the ability to sync additional user folders and the ability to fine-tune the automatic synchronization of page changes - plus much more!

Syncing Additional User Folders

The initial release of the Git Sync plugin featured seamless synchronization of Grav pages, but behind the scenes support for syncing additional folders was already in the works. With this release, this ability is now fully accessible both in the Git Sync Wizard and Plugin Settings.

Git Sync 2.0 Wizard

Figure 1 - Folder selection in Git Sync Wizard, with the pages and themes folders selected

Git Sync 2.0 Custom Folder Field

Figure 2 - Folder selection in Git Sync Settings, with the pages and themes folders selected

By default, Pages will be seamlessly and automatically synced to a Git repository, but now other components such as Themes and Plugins can be too. Syncing Themes to a Git repository is particularly useful in providing a means of Grav authors to provide hands-on help (via Pull Requests) with custom Theme adjustments/troubleshooting, CSS, etc. In addition, when developing a Grav site locally Theme changes can be pushed to a Git repository and then automatically synced by Git Sync to the Web server. Even better, is that you can even set just the active theme to be synced (i.e. themes/mytheme).

Git Sync 2.0 Custom Folder Field with Sub-folder

Figure 3 - Folder selection for Git Sync settings, with the pages folder and themes/mytheme subfolder selected

For more advanced purposes, other folders such as Config and Data can also be synced, but doing so should be done with caution and only usually in private repositories.

Automatic Synchronization Settings

While automatic Git sync is a seamless process it does increase the time needed to fully save a page. Based on a PR submitted by Amaury Carrade, there is now the ability to choose when automatic synchronization occurs with various page operations.

Git Sync 2.0 Auto Sync Settings

Figure 4 - Automatic Synchronization options, with Scheduler support in the upcoming Grav 1.6 release

With these options, automatic synchronization can be temporarily turned off while a large number of pages are added/edited or turned off permanently using the integrated Scheduler synchronization feature (Grav 1.6 required).

And Much More!

In addition to the above, a shout out to the other members of the Grav community who also contributed to this release through various PR's which included such things as support for Webhook Secrets, using the current Grav user email for Git commits, and support for Git Repository Branches - learn all the details in the 2.0 ChangeLog. Thanks to all of the contributors, and of course a special thanks to Djamil Legato of Trilby Media for his continued amazing work on Git Sync.

With this update, the Git Sync Plugin reaches a new level of power and flexibility for the entire Grav community!

Git-Sync 2.0 Changelog


21 hours ago

    • Added support for new awesome Grav 1.6 Scheduler
    • Added logic to display custom nested folders in wizard
    • Other than pages, it is now possible to enable config, data, plugins and themes for synchronization. You can also add any custom folder you have in your user (#4, #21, #34, #58, #63, #83)
    • Allow users with admin.pages permissions to synchronize through quick tray (#79, thanks @apfrod)
    • When using Grav as committer, the user email will be now used for the commit (#81, thanks @apfrod)
    • Added support for Webhook Secret (Bitbucket does not yet support them) (#72, #73, thanks @pathmissing)
    • Added options to turn automatic synchronization on/off with page saves, delete and media changes (#105, thanks @AmauryCarrade)
    • Fixed alignment of the git icon in the Wizard (#115)
    • Prevent Wizard modal to get canceled when clicking on the overlay background (#115)
    • Quick tray icon is now smarter. If GitSync has not been initialized yet, it will take you straight to wizard, otherwise it would perform a synchronization (#115)
    • Rearranged blueprint order (thanks @paulhibbitts)
    • GitLab: Updated wizard instructions to be inline with the new GitLab UI (#90)
    • Tweaked alignment of links in the wizard (#57)
    • Properly support local branches that aren't master (#56)
    • Allow to specify custom local_repository (default, USER_DIR) (#95, thanks @Hydraner, also #54, #33, #25)
    • Webhook URL is now more robust and secure, by default it is generated with a random value
    • Git icon from Admin has been replaced to use the git text icon instead of the logo
    • Prevent next step if Step 1 and Step 2 are not filled in (#92)
    • Added notice in Step 2 explaning what GitSync expect from the repository structure (#92)
    • Fixed issue where on first initialization the checkout process would error out
    • Fixed issue with Pages save.
    • Fixed JS error in plugins list
    • Fixed nested folders not synchronizing
    • Fixed issue where Wizard wouldn't work in case the admin path was modified (#27, #94, #77, thanks @pathmissing)
    • Fixed webhook generated URL when multi-lang active (#71)
    • Resolved issue with untracked/uncommited files at the root of the sync folder. (#101, thanks @ScottHamper)
Grav Premium
Turbo-charge your Grav site - from the creators of Grav