Kirby Hook to git commit+push

Hi all, I’m trying to use a Kirby hook to commit and push changes to the content folder from a production environment back to my git repository.

My confusion is regarding when (if at all) site.update:after is triggered when a Panel user makes changes. Ideally I can trigger a git commit+push after a batch of changes are made, as opposed to using page.update:after which would generate a ton of individual commits+pushes. Any tips?

Thanks!

Hm, if you want to avoid a lot of mini-commits, your best bet is to trigger commits manually or to maybe use a cron job that checks at regular intervals if any changes occurred and commits them.

This is triggered whenever you make changes to site.txt via the Panel, i.e. any changes to fields on the “Dashboard” (the view you see after you have logged in). If you don’t have editable content in your site object (i.e. no fields defined in site.yml), this hook will never be fired.

1 Like