• Stars
    star
    233
  • Rank 171,704 (Top 4 %)
  • Language
    PHP
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Collaboratively Synchronize your Grav `user` folder hosted on GitHub, BitBucket or GitLab

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)

To install git-sync simply run this command from the Grav root folder

bin/gpm install git-sync

After having installed the plugin, make sure to go in the plugin settings in order to get the Wizard configuration started.

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 repositories
  • Basic SSH / Enterprise support (You will need SSH Key properly setup on your machine)
  • Synchronize any folder under user (pages, themes, config)
  • 2FA (Two-Factor Authentication) and Access Token support
  • Webhooks support allow for automatic synchronization from the Git Repository with secure Webhook URL auto-generated and support for Webhook Secret (when available)
  • 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 for manual synchronization
  • Support for Admin Quick Tray, so you can synchronize from anywhere in Admin
  • Ability to customize whether GitSync should synchronize upon save or just manually
  • 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 commands to automate synchronizations
  • Log any command performed by GitSync to ensure everything runs smoothly or debug potential issues

Command Line Interface

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

To execute the command simply run:

bin/plugin git-sync sync

You can also get a status by running:

bin/plugin git-sync status

Since version 2.1.1 you can now also programmatically change user/password via the bin/plugin git-sync passwd. This is useful if you have a container that resets your password, or you have some running scripts that require to programmatically update the password.

Requirements

In order for the plugin to work, the server needs to run git 1.7.1 and above.

The PHP exec() and escapeshellarg() functions are mandatory. Ensure the options to be enabled in your PHP.

SSH / Enterprise

Since version v2.3.0, GitSync supports SSH authentication. This means you can omit password altogether and rely on the Repository URL and SSH key on your machine, that you can point to from the Advanced settings in GitSync.

Please note that In order to be able to sparse-checkout and push changes, it is expected you have an ssh-key configured for accessing the repository. This is usually found under ~/.ssh and it needs to be configured for the same user that runs the web-server.

Point it to the secret (not the public) and make also sure you have strict permissions to the file. (-rw-------).

Example: private_key: /home/www-data/.ssh/id_rsa

IMPORTANT: SSH keys with passphrase are NOT supported. To remove a passphrase, run the ssh-keygen -p command and when asked for the new passphrase leave blank and return.

Known Issues and Resolutions

Q: error: The requested URL returned error: 403 Forbidden while accessing... (reference, #39)
A: This might be caused by your computer having stored in the registry a user/password that might conflict with the one you are intending to use.
Follow the instructions for resolving the issue...

Sponsored by

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

More Repositories

1

grav-plugin-tntsearch

Powerful indexed-based full text search engine powered by the TNTSearch library
PHP
59
star
2

grav-plugin-flex-directory

Flexible plugin that allows CRUD functionality on complex data types
PHP
39
star
3

grav-plugin-flex-objects

Powerful and supremely flexible object support for Grav
PHP
39
star
4

grav-plugin-login-oauth2

OAuth2 Client Plugin to integrate with Grav's Login
PHP
16
star
5

grav-theme-bootstrap4

Twig
14
star
6

grav-plugin-page-toc

Grav TOC Plugin with new independent Anchor generation to compliment the existing Table-of-Contents support.
PHP
12
star
7

grav-plugin-image-captions

PHP
10
star
8

grav-plugin-login-ldap

Grav LDAP login plugin
PHP
9
star
9

grav-plugin-login-oauth2-extras

Extra providers for Login OAuth2 Plugin
PHP
7
star
10

grav-plugin-prism-highlight

CSS
5
star
11

grav-plugin-quick-tray-links

PHP
5
star
12

grav-plugin-views

Grav plugin to track views
PHP
5
star
13

grav-plugin-dns-blacklist

A simple yet useful Grav plugin to check if an IP address is DNS Blacklisted
PHP
3
star
14

grav-skeleton-bootstrap4-site

3
star
15

grav-plugin-vcard

PHP
3
star
16

grav-plugin-custom-http-headers

PHP
3
star
17

grav-skeleton-typhoon-onepage

The Typhoon One-Page skeleton is a package to showcase the Typhoon Grav Premium theme
3
star
18

grav-plugin-slack-invite

PHP
2
star
19

grav-plugin-social-counters

PHP
2
star
20

grav-plugin-faker

Create fake content for testing
PHP
2
star
21

grav-plugin-login-oauth2-apple

"Sign in with Apple" OAuth2 Integration
PHP
1
star
22

grav-skeleton-typhoon-blog

The Typhoon Blog skeleton is a package to showcase the Typhoon Grav Premium theme
1
star
23

grav-skeleton-downloads-demo

The Downloads Pro Skeleton, as seen as on the Downloads Pro Plugin demo.
Rich Text Format
1
star
24

grav-plugin-color-tools

PHP
1
star