PHPackages                             thathoff/kirby-git-content - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thathoff/kirby-git-content

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

thathoff/kirby-git-content
==========================

Plugin to track changes to content in a git repository.

v5.4.0(6mo ago)15343.7k↓26.6%25[3 issues](https://github.com/thathoff/kirby-git-content/issues)[1 PRs](https://github.com/thathoff/kirby-git-content/pulls)MITPHPCI passing

Since Jan 18Pushed 4mo ago7 watchersCompare

[ Source](https://github.com/thathoff/kirby-git-content)[ Packagist](https://packagist.org/packages/thathoff/kirby-git-content)[ RSS](/packages/thathoff-kirby-git-content/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (28)Used By (0)

Kirby Git Content
=================

[](#kirby-git-content)

This is a plugin for [Kirby](http://getkirby.com/) that commits and pushes content changes made via the Panel to your git repository.

[![Screnshot of Panel Area](/.github/screenshot.png?raw=true)](/.github/screenshot.png?raw=true)

Requirements
------------

[](#requirements)

This plugin supports **Kirby from version 3.6 (including Kirby 4 and 5)** and requires **git version &gt; 2.24**

Please make sure that PHP on your server has not disabled both `proc_open` and `proc_close` as they are required by czproject/git-php used to communicate with git.

Another requirement is that the git repository in your content folder is owned by the user running the PHP process otherwise git failes with a `dubious ownership` error.

If you are **updating to Kirby 5**, please make sure to add the `_changes` folder to your `.gitignore` file.

Usage
-----

[](#usage)

You can use this plugin to commit and push changes made via the Panel to your git repository. Either automatically by setting the `commit` option to `true` or manually by visiting the panel view and adding a commit.

Setup
-----

[](#setup)

### Download and configure the Plugin

[](#download-and-configure-the-plugin)

#### Installation via composer (recommended)

[](#installation-via-composer-recommended)

`composer require thathoff/kirby-git-content`

#### Installation via git submodule

[](#installation-via-git-submodule)

`git submodule add https://github.com/thathoff/kirby-git-content.git site/plugins/git-content`

#### Manual Installation

[](#manual-installation)

- [download the source code](https://github.com/thathoff/kirby-git-content/archive/main.zip)
- copy the folder to `site/plugins/git-content`.

### Create a new git repository for your content

[](#create-a-new-git-repository-for-your-content)

Create a new git repository where you push your content to init the content repo and push it.

```
cd content

# for Kirby 3 and 4 include .lock files in .gitignore
echo ".lock" >> .gitignore

# for Kirby 5 add the _changes folder to .gitignore
echo "_changes" >> .gitignore

# init repo
git init
git add .
git commit -m "Initial Commit"
```

Please note: Make a first commit to the repository. If you have a repository with no commits, the git content view in the panel will not work.

Remove the `content/` folder from your current git repository

```
cd ..
git rm --cached -r content
git add -A
git commit -m "Move Content Folder to separate repository"
```

Configuration
-------------

[](#configuration)

By default this plugin just commits changes to the content repository. It’s recommended to setup a cron job which calls `yourdomain.com/git-content/push`. This will push changes to the remote repository. By using a cron job saving pages in panel is a lot faster then enabling the `push` option which will push changes after every commit.

This plugin is configurable via [Kirby Options](https://getkirby.com/docs/guide/configuration). Add the following entires to your `config.php`.

```
return [
  // other configuration options
  'thathoff.git-content.commit' => true,
];
```

### Configuration Options

[](#configuration-options)

- `path` (String): Path to the repository, (default: `kirby()->root("content")`)
- `pull` (Boolean): Pull remote changes first? (default: `false`)
- `commit` (Boolean): Commit your changes? (default: `true`)
- `push` (Boolean): Push your changes to remote? (default: `false`)
- `commitMessage` (String): Configure the template for the commit message (default: `:action:(:item:): :url:`)
- `cronHooksEnabled` (Boolean): Whether `/git-content/push` and `/git-content/pull` endpoints are enabled or not. (default: `true`)
- `cronHooksSecret` (String): When set, this secret must be sent with the cronHooks as a get parameter, see [Cron / Webhooks](#cron--webhooks) for more details.
- `displayErrors` (Boolean): Display git errors when saving pages (default: `true`)
- `gitBin` (String): Path to the `git` binary
- `disable` (Boolean): If set to `true`, the plugin won't initialize. (default: `false`)
- `disableBranchManagement` (Boolean): If set to `true`, the options to create and switch branches are hidden. (default: `false`)
- `helpText` (String): Supply a custom help text shown in the panel UI. (default: `null`)
- `menuIcon` (String): Supply a custom icon for the panel menu item. (default: `sitemap`)
- `menuLabel` (String): Supply a custom label for the panel menu item. (default: `Git Content`)
- `buttons` (Array): Enable or disable buttons in the panel UI. See [Buttons &amp; Permissions](#buttons--permissions) for options.

### Cron / Webhooks

[](#cron--webhooks)

The plugin provides three webhook that you can trigger via cron or webhooks in your CI/CD pipeline. You can enable or disable the webhooks by setting the `cronHooksEnabled` option.

- `/git-content/push`: Pushes changes to the remote repository.
- `/git-content/pull`: Fetches the latest changes from the remote repository.
- `/git-content/reset`: Resets the local repository to the remote repository (requires a secret to be set).

You can call the webhooks via HTTP GET or POST request. If you have a secret set, you can either provide the secret as a query parameter or as a body parameter.

```
curl https://example.com/git-content/pull?secret=S0up3rS3c3t"
curl -X POST https://example.com/git-content/push --data "secret=S0up3rS3c3t"
```

### Buttons &amp; Permissions

[](#buttons--permissions)

The plugin allows you to enable or disable buttons in the panel UI either globally or per role.

To enable or disable buttons globally, set the `buttons` option to an array of button names. The keys are:

- `fetch`: Fetches the latest changes from the remote repository.
- `commit`: Allows to commit changes to the repository.
- `pull`: Allows to pull changes from the remote repository.
- `push`: Allows to push changes to the remote repository.
- `createBranch`: Allows to create a new branch.
- `switchBranch`: Allows to switch to a different branch.
- `removeIndexLock`: Removes the index lock file if it exists.
- `reset`: Resets the local repository to the remote repository (disabled by default).

```
return [
  'thathoff.git-content.buttons' => [
    'reset' => true, // enables the reset to origin button (default: false)
    'fetch' => false, // disables the fetch button (default: true)
  ],
];
```

You also can enable or disable buttons per role by adding the permission to to users blueprint. For example to disable the fetch button for the role `editor`, add the following to the `editor` blueprint:

```
permissions:
  thathoff.git-content:
    fetch: false
```

You can use the same keys as in the `buttons` option to enable or disable buttons per role.

### Custom Commit Message

[](#custom-commit-message)

By default the commit message is composed from the template `:action:(:item:): :url:`. So for example a change to the page `example` will be committed with the message `update(page): example`. If you would like to change that message you can use the `thathoff.git-content.commitMessage` option to overwrite the template.

Hooks
-----

[](#hooks)

The plugin triggers hooks before and after content is pulled or pushed via the interface or the web endpoints. You can use these hooks to trigger other actions, for example to deploy your site after a push or clear caches after a pull.

```
// site/config/config.php

return [
  // other configuration options
  'hooks' => [
    'thathoff.git-content.push:before' => function () {
      // do something before a push
    },
    'thathoff.git-content.push:after' => function ($response) {
      // do something after a push
    },
    'thathoff.git-content.pull:before' => function () {
      // do something before a pull
    },
    'thathoff.git-content.pull:after' => function ($response) {
      // do something after a pull
    },
  ],
];
```

Git LFS
-------

[](#git-lfs)

Your repository might increase over time, by adding Images, Audio, Video, Binaries, etc. cloning and updating your content repository can take a lot of time. If you are able to use [Git LFS](https://git-lfs.github.com/) you probably should. Here is what the .gitattributes-File could look like:

```
*.zip filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text

```

Running on Shared Hosting
-------------------------

[](#running-on-shared-hosting)

Running this plugin on shared hosting can be tricky. You need to ensure that the PHP process has access to the Git binary, and that the repository is owned by the user running the PHP process.

Accessing the repository via SSH may also be difficult. In these cases, it may be easier to use the HTTPS URL. Check out the repository using HTTPS, a personal access token or password, depending on your Git provider.

When cloning the repository, you can include the username and password like this:

```
git clone https://username:personal-access-token@github.com/yourusername/yourrepository.git
```

Authors
-------

[](#authors)

Maintained and developed by [Markus Denhoff](https://markus.denhoff.com) and [Contributors](https://github.com/thathoff/kirby-git-content/graphs/contributors). Initial version by [Pascal Küsgen](https://github.com/Pascalmh).

Supported by [reinorange GmbH](https://reinorange.com).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance71

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 78% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~133 days

Recently: every ~218 days

Total

25

Last Release

198d ago

Major Versions

1.5.0 → 2.0.02017-03-07

v2.2.2 → v3.0.0-beta.12019-01-24

v3.0.3 → v4.0.02020-10-25

v4.1.0 → v5.0.02022-08-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/294281c8d16ff7ca50dbc97250ba6a7422cc7349caf00fa8d6bf9882e817a35c?d=identicon)[Pascalmh](/maintainers/Pascalmh)

![](https://www.gravatar.com/avatar/e313f1ec98c211100e91b929b574203dc78572be0812d1c4015881d33e2c3fe7?d=identicon)[markusdenhoff](/maintainers/markusdenhoff)

---

Top Contributors

[![thathoff](https://avatars.githubusercontent.com/u/797760?v=4)](https://github.com/thathoff "thathoff (99 commits)")[![cstmth](https://avatars.githubusercontent.com/u/67071898?v=4)](https://github.com/cstmth "cstmth (7 commits)")[![bastianallgeier](https://avatars.githubusercontent.com/u/24532?v=4)](https://github.com/bastianallgeier "bastianallgeier (3 commits)")[![tobiastom](https://avatars.githubusercontent.com/u/49210?v=4)](https://github.com/tobiastom "tobiastom (2 commits)")[![jake](https://avatars.githubusercontent.com/u/285917?v=4)](https://github.com/jake "jake (2 commits)")[![mrunkel](https://avatars.githubusercontent.com/u/3205232?v=4)](https://github.com/mrunkel "mrunkel (2 commits)")[![s3ththompson](https://avatars.githubusercontent.com/u/970121?v=4)](https://github.com/s3ththompson "s3ththompson (2 commits)")[![JonasDoebertin](https://avatars.githubusercontent.com/u/1367270?v=4)](https://github.com/JonasDoebertin "JonasDoebertin (1 commits)")[![lukasbestle](https://avatars.githubusercontent.com/u/1595007?v=4)](https://github.com/lukasbestle "lukasbestle (1 commits)")[![therephil](https://avatars.githubusercontent.com/u/4098146?v=4)](https://github.com/therephil "therephil (1 commits)")[![Pascalmh](https://avatars.githubusercontent.com/u/498197?v=4)](https://github.com/Pascalmh "Pascalmh (1 commits)")[![qwerdee](https://avatars.githubusercontent.com/u/18071758?v=4)](https://github.com/qwerdee "qwerdee (1 commits)")[![radibit](https://avatars.githubusercontent.com/u/1242621?v=4)](https://github.com/radibit "radibit (1 commits)")[![CHE1RON](https://avatars.githubusercontent.com/u/122524301?v=4)](https://github.com/CHE1RON "CHE1RON (1 commits)")[![graphichavoc](https://avatars.githubusercontent.com/u/32615248?v=4)](https://github.com/graphichavoc "graphichavoc (1 commits)")[![hariom147](https://avatars.githubusercontent.com/u/8297800?v=4)](https://github.com/hariom147 "hariom147 (1 commits)")[![chrfickinger](https://avatars.githubusercontent.com/u/91317?v=4)](https://github.com/chrfickinger "chrfickinger (1 commits)")

---

Tags

gitkirbypanelpanel-widget

### Embed Badge

![Health badge](/badges/thathoff-kirby-git-content/health.svg)

```
[![Health](https://phpackages.com/badges/thathoff-kirby-git-content/health.svg)](https://phpackages.com/packages/thathoff-kirby-git-content)
```

###  Alternatives

[distantnative/retour-for-kirby

Manage redirects and track 404s right from the Kirby CMS Panel

14689.4k1](/packages/distantnative-retour-for-kirby)[mzur/kirby-uniform

A versatile Kirby plugin to handle web form actions.

26068.3k13](/packages/mzur-kirby-uniform)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[sylvainjule/locator

A map &amp; geolocation field, built on top of open-source services / Mapbox

11237.3k1](/packages/sylvainjule-locator)[tobimori/kirby-seo

The default choice for SEO on Kirby: Implement technical SEO &amp; Meta best practices with ease and provide an easy-to-use editor experience

10039.7k1](/packages/tobimori-kirby-seo)[fabianmichael/kirby-meta

Your all-in-one powerhouse for any SEO and metadata needs imaginable.

6910.7k1](/packages/fabianmichael-kirby-meta)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
