{% set settings = config.plugins['git-sync'] %} {% set frontend_url = (uri.base ~ uri.rootUrl)|trim('/') %}
This wizard will guide you through a few simple steps that will help you set up the plugin and your repository. When done you will have a bi-directional synchronization link between your site and the repository.
Press Next to continue.
Select the repository-hosting service that you will be using to remotely store your data. Once you picked one, insert the username and password or token to access the service. Passwords are saved securely.
If you have never used Access Tokens or don't know what 2FA is, you most likely only need your regular password for the field above. You can then skip this step and press Next to continue.
However be aware that some services such as GitHub, don't accept your plain password any longer and require the use of Access Token. You should use the Access Token as you preferred method.
With GitSync you have the option to use an Access Token instead of your password, however if you have 2FA (Two-factor authentication) enabled for your git service, you can only use Access Tokens.
Using a token is more secure than using your password, because you can limit what can be done using it and it can be revoked without worrying about changing the password. As we are just syncing, we only need to give it read-and-write access to repositories and webhooks.
With GitHub's Personal Access Tokens, select the following Scopes:
repo
(Full control of private repositories)admin:repo_hook
(Full control of repository hooks)With BitBucket's App Passwords, select the following Permissions:
Read
Write
Read and write
Usually under your profile settings is where you can generate a new Access Token. You want to ensure that you have enough read/write access for the repository as well as webhook
access
Press Next to continue.
If you already have a repository set up and ready to use, you can skip this step. Otherwise, please follow these steps:
Follow the instructions on GitHub Help to create a new GitHub repository.
Follow the instructions on Atlassian Documentation to create a new Bitbucket repository. Make sure you select Git as repository type.
GitLab calls repositories "Projects". Follow the instructions on GitLab Documentation to create a new GitLab repository.
When you copy the HTTPS URL from Bitbucket, it also adds your-user@
at the beginning of the URL which is not needed and should be removed. The URL be something like https://bitbucket.org/your-user/your-repository.git
Verify Authentication, Connection and Branch
Press Next to continue.
A Webhook synchronizes the site when a change happens in the repository, and is set up at the service provider. This is a special URL to your site, that you add to your repository's settings. We've auto-generated one for you below, but you can change this to whatever you'd like.
You can also use a secret token if your service provider supports it:
Follow the steps below to add the Webhook to your service provider.
Settings
Webhooks
in the left sidebarAdd webhook
-button on the right{{ frontend_url }}{{ settings.webhook|default('/_git-sync') }}
application/json
' ~ settings.webhook_secret ~ '
' : 'leave empty')|raw }}Just the push event.
Add webhook
-button Settings
in the sidebar (if the sidebar is collapsed, this is represented by just a )Webhooks
on the left sidebar of the page that just loadedAdd webhook
-button at the top{{ frontend_url }}{{ settings.webhook|default('/_git-sync') }}
Save
-button Settings
dropdown-button from the page sidebarIntegrations
(or Webhooks
if < v8.16) from the list{{ frontend_url }}{{ settings.webhook|default('/_git-sync') }}
' ~ settings.webhook_secret ~ '
' : 'leave empty')|raw }}Add Webhook
-button{{ frontend_url }}{{ settings.webhook|default('/_git-sync') }}
' ~ settings.webhook_secret ~ '
' : 'leave empty')|raw }}Add Webhook
buttonPress Next to continue.
Select which user/ folders you would like to independently synchronize (default: Pages).
This folder contains all the user accounts of the site.
This folder contains all the site configurations.
This folder contains all the stored data from plugins.
This folders contains all the pages of your site.
This folders contains all the plugins installed in your site.
This folders contains all the themes installed in your site.
Careful! This folder can contain sensitive data and synchronizing it will potentially expose the data publicly. Private repository recommended.
Note that changes happening in this folder can't be detected automatically by GitSync, therefore a manual synchronization will be required.
{% for folder in settings.folders if '/' in folder %}This folders was manually added either by you in the settings or by your Skeleton.
{% endfor %}Press Save to complete the setup.
The GitSync plugin requires the (Git) binary to be installed and accessible in order to work.
If (Git) is missing from your hosting provider, you should open a ticket with them and request it to be installed.
You can also specify a custom path in the Advanced section down below at the Git Binary Path field. If you are using Windows (VM, Azure or a local setup), you might have to change the location accordingly (quotes do matter), for example:
"D:\Program Files\Git\bin\git.exe"
.