PHPackages                             oblik/kirby-git - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. oblik/kirby-git

ActiveKirby-plugin[DevOps &amp; Deployment](/categories/devops)

oblik/kirby-git
===============

Shows you Git changes in the Kirby panel and allows you to add/commit/push them, manually or automatically.

2.0.0(2y ago)8310.4k6[14 issues](https://github.com/oblik/kirby-git/issues)[8 PRs](https://github.com/oblik/kirby-git/pulls)MITVueCI failing

Since Apr 11Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/oblik/kirby-git)[ Packagist](https://packagist.org/packages/oblik/kirby-git)[ GitHub Sponsors](https://github.com/sponsors/OblikStudio)[ RSS](/packages/oblik-kirby-git/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (6)Dependencies (3)Versions (17)Used By (0)

**For contributing instructions, please check [CONTRIBUTING.md](./CONTRIBUTING.md). Thanks!**

**Note:** Once the Kirby 3.6 docs come up (especially the [UI Kit](https://getkirby.com/docs/reference/plugins/ui) ones), I'll be able to invest some time and add a few features I've planned for a while.

Kirby Git
=========

[](#kirby-git)

Shows you Git changes in the Kirby panel and allows you to add/commit/push them, manually or automatically.

[![demo gif in the panel](demo.gif)](demo.gif)

Installation
============

[](#installation)

With [Composer](https://packagist.org/packages/oblik/kirby-git):

```
composer require oblik/kirby-git

```

**Note:** This plugin requires Git version `2.22.0` or above. Check how to update it on your server [here](https://unix.stackexchange.com/a/170831/405871).

Usage
=====

[](#usage)

In order to work successfully with this plugin (and Git in general), you need separate branches in order to avoid overwriting history.

Let's say your repository is hosted on GitHub. This means you have a remote called `origin` and it points to that GitHub repo. Example setup:

- `live` is the branch that is checked out on the live server. Content changes are pushed to `origin/live` from the panel via this plugin. You should **never** push to `origin/live` by other means. This would allow editors to always be able to commit and push new changes.
- `dev` is the branch where you do development work locally on your machine. You can freely make both site changes *and* content changes and push them to `origin/dev` for other developers to pull.
- `master` is where you merge the other two branches. You pull content changes from `origin/live`, merge them with your local changes on `dev`, resolve conflicts *locally*, and push to `origin/master`.

Whenever someone in the panel issues a pull, the `origin/master` branch will be fetched and merged with the local `live` on the server **if, and only if** a [fast-forward](https://git-scm.com/docs/git-merge#Documentation/git-merge.txt---ff-only) merge is possible. This means that if there are changes on `live` that are not reflected on `origin/master`, the merge will fail.

Example flow:

1. You push C1 (commit 1) and C2 from your `dev` to `origin/dev`
2. Editors push C3 and C4 from `live` to `origin/live`
3. You pull C3 and C4 from `origin/live` to your local `live`
4. You merge your `master` with your `dev` and your `live`, resulting in a merge commit C5
5. Your `master` now has all C1, C2, C3, and C4 and you push it to `origin/master`
6. Editors will be able to pull `origin/master` and fast-forward to C5, which has your C1 and C2

If editors created a new commit C6 on their `live` **before** merging with `origin/master`, the merge would have failed because C6 does not yet exist on `origin/master`. So they push C6 to `origin/live`, you pull it, merge it with `master`, and push it to `origin/master`. After that, editors would be able to pull.

Config
------

[](#config)

The plugin expects a repo to already be initialized and set up. You just give a path to that repo and check out the branch it should use.

Options for the plugin are specified with dot notation in `site/config/config.php`. For example:

```
return [
    'oblik.git.repo' => '/path/to/repo',
    'oblik.git.merge' => 'master',
    ...
];
```

### bin

[](#bin)

What executable to use. You might need to specify this option if there are multiple versions of Git on the machine.

**Default:** `git`

### repo

[](#repo)

Path to a folder containing a Git repo (a `.git` folder).

**Default:** `kirby()->root('index')` (the project folder)

### remote

[](#remote)

What remote to use for pulling from and pushing to remote branches.

**Default:** `origin`

### merge

[](#merge)

What branch to be used for merging when issuing a pull.

**Default:** `master`

### hooks

[](#hooks)

An array of [Kirby hooks](https://getkirby.com/docs/reference/plugins/extensions/hooks) to use as a trigger for `git add` and `git commit`. Example:

```
return [
    'oblik.git.hooks' => [
        'site.update:after',
        'page.update:after'
    ]
];
```

With the above config, a new commit will be created any time a page or the site object is updated. However, this could bloat your repository with hundreds (or even thousands) of commits. You could use a hook like [`user.login:after`](https://getkirby.com/docs/reference/plugins/hooks/user-login-after) that gets triggered more rarely.

**Default:** `null`

### log

[](#log)

Absolute path to a file where each command executed by this plugin will be logged. Example:

```
return [
    'oblik.git.log' => '/path/to/kirby-git.log'
];
```

Logs will look like this:

```
git -C /var/www/site status -u --porcelain 2>&1
git -C /var/www/site rev-list --count master 2>&1
git -C /var/www/site log origin/master..master --format=%h 2>&1
git -C /var/www/site log master --pretty=format:"%h|%an|%ae|%ad|%s" --skip="0" --max-count="15" 2>&1
...

```

**Default:** `false`

Section
-------

[](#section)

For displaying a summary of Git changes, you could use the `git` section in a blueprint:

```
title: Page
sections:
  changes:
    type: git
    headline: Git Status
```

[![git status section](section.jpg)](section.jpg)

View
----

[](#view)

In the panel view, you can add, commit, and push changes in a very simple manner. Just three columns and three buttons:

[![git panel view](view.png)](view.png)

REST API
--------

[](#rest-api)

The plugin uses Kirby's REST API to provide a means for the panel view to communicate with PHP. You can use it as well! Check the various routes [here](../lib/routes.php).

API
---

[](#api)

You can work with Git via the [`Git`](../lib/Git.php) class as well. For example:

```
use Oblik\KirbyGit\Git;

$git = new Git();
$git->add();
$git->commit('my message');
$git->push();
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance57

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 87.9% 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 ~278 days

Recently: every ~348 days

Total

6

Last Release

834d ago

Major Versions

1.4.0 → 2.0.02024-02-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/078077710a1481f0419521ab1e1d3e5f93723aadd56148937ee3e355b93acb2e?d=identicon)[hdodov](/maintainers/hdodov)

---

Top Contributors

[![yandodov](https://avatars.githubusercontent.com/u/5570098?v=4)](https://github.com/yandodov "yandodov (109 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![pstaender](https://avatars.githubusercontent.com/u/140571?v=4)](https://github.com/pstaender "pstaender (3 commits)")

---

Tags

gitkirbykirby-3kirby-cmskirby-panelkirbykirby-plugin

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[oblik/kirby-link-field

Kirby 4 field for all types of links.

7650.6k2](/packages/oblik-kirby-link-field)[belugadigital/kirby-navigation

Kirby 5 field for hierarchical menus with drag &amp; drop level indentation.

8713.4k](/packages/belugadigital-kirby-navigation)[tobimori/kirby-tailwind-merge

Tailwind Merge for Kirby CMS

276.3k](/packages/tobimori-kirby-tailwind-merge)[leitsch/kirby-blade

Enable Laravel Blade Template Engine for Kirby 4 and Kirby 5

219.2k](/packages/leitsch-kirby-blade)

PHPackages © 2026

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