Gitlib
Library for accessing Git repositories with PHP
Install / Use
/learn @gitonomy/GitlibREADME
Gitlib for Gitonomy
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.
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
