Git Sync
Sync instantly with webhooks
Git Sync runs on a schedule (every hour by default). Two options make it instant in both directions:
- Push when a doc is published or updated sends the change to the repository a few seconds after you click Update.
- A webhook publishes commits in WordPress within seconds of a push.
Push from WordPress
On the PinkDocs → Git Sync page, turn on Push when a doc is published or updated. That's all: every saved doc goes to the repository as a commit, or as a pull request if you chose that.
Add the webhook
- In your repository, open Settings → Webhooks and click Add webhook.
- Paste the Webhook URL from the Git Sync page, set Content type to
application/jsonand paste the Secret. - Keep Just the push event and save.
GitHub sends a test ping, and Git Sync shows when it last received one.
- In your project, open Settings → Webhooks and click Add new webhook.
- Paste the Webhook URL and the Secret token from the Git Sync page.
- Tick Push events only and save.
No sync loops
PinkDocs ignores pushes to other branches, pushes that don't touch the docs folder, and its own commits, so a sync never triggers another one. Every webhook request is checked against the secret.
Your site must be reachable
GitHub and GitLab have to reach your site for the webhook to work, so it won't work on a local development site. Scheduled syncs still run.
Troubleshooting
GitHub and GitLab show the response to each webhook delivery in the webhook's settings.
| Response | What it means |
|---|---|
| 401 Invalid signature | The secret doesn't match. Copy it again from the Git Sync page. |
| 404 Git Sync is not enabled | Turn on Sync this knowledge base on the Git Sync page. |
| 202 Ignored: another branch | The push went to a branch Git Sync doesn't follow. Check the Branch setting. |
| 202 Ignored: no changes in the docs folder | Only files inside the docs folder are synced. |
| No response at all | Check the URL was pasted in full and your site is public. A security or firewall plugin may block requests to /wp-json/. |
Was this page helpful?
Great! What worked best for you?
Please provide additional details about your experience.
Thank you for your feedback!
We appreciate your input.
