Download the PHP package oblik/kirby-git without Composer

On this page you can find all versions of the php package oblik/kirby-git. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-git

For contributing instructions, please check CONTRIBUTING.md. Thanks!

Note: Once the Kirby 3.6 docs come up (especially the UI Kit ones), I'll be able to invest some time and add a few features I've planned for a while.

Kirby Git

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

Installation

With Composer:

Note: This plugin requires Git version 2.22.0 or above. Check how to update it on your server here.

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:

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 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

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:

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

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

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

remote

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

Default: origin

merge

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

Default: master

hooks

An array of Kirby hooks to use as a trigger for git add and git commit. Example:

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 that gets triggered more rarely.

Default: null

log

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

Logs will look like this:

Default: false

Section

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

View

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

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.

API

You can work with Git via the Git class as well. For example:


All versions of kirby-git with dependencies

PHP Build Version
Package Version
Requires getkirby/cms Version ^4
getkirby/composer-installer Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package oblik/kirby-git contains the following files

Loading the files please wait ....