Skip to content

Library for accessing Git repositories with PHP

License

Notifications You must be signed in to change notification settings

andreaskienast/gitlib

This branch is 13 commits behind gitonomy/gitlib:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e4e06bb · May 22, 2023
May 22, 2023
Mar 28, 2020
May 11, 2023
May 22, 2023
Nov 24, 2014
Jul 30, 2020
Sep 6, 2012
Jan 3, 2023
May 22, 2023
Jan 23, 2022
Feb 2, 2013

Repository files navigation

Gitlib for Gitonomy

Build Status StyleCI License Downloads

This library provides methods to access Git repository from PHP 5.6+.

It makes shell calls, which makes it less performant than any solution.

Anyway, it's convenient and don't need to build anything to use it. That's how we love it.

Quick Start

You can install gitlib using Composer. Simply require the version you need:

$ composer require gitonomy/gitlib

or edit your composer.json file by hand:

{
    "require": {
        "gitonomy/gitlib": "^1.3"
    }
}

Example Usage

<?php

use Gitonomy\Git\Repository;

$repository = new Repository('/path/to/repository');

foreach ($repository->getReferences()->getBranches() as $branch) {
    echo '- '.$branch->getName().PHP_EOL;
}

$repository->run('fetch', ['--all']);

API Documentation

For Enterprise

Available as part of the Tidelift Subscription

The maintainers of gitonomy/gitlib and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

About

Library for accessing Git repositories with PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.1%
  • Shell 0.9%