gitonomy / gitlib
Library for accessing git
Fund package maintenance!
Tidelift
Installs: 13 323 406
Dependents: 60
Suggesters: 0
Security: 0
Stars: 448
Watchers: 25
Forks: 71
Open Issues: 18
Requires
- php: ^8.0
- ext-pcre: *
- symfony/polyfill-mbstring: ^1.7
- symfony/process: ^5.4 || ^6.0 || ^7.0
Requires (Dev)
- ext-fileinfo: *
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^7.5.20 || ^8.5.20 || ^9.5.9
- psr/log: ^1.0
This package is auto-updated.
Last update: 2024-09-21 09:45:35 UTC
README
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.