gitonomy/gitlib
Gitonomy Gitlib is a PHP library for interacting with Git repositories programmatically. Read commits, trees, branches, tags and diffs; run Git commands via a clean API and work with local repos from your apps, tools, or CI scripts.
Install via Composer: composer require gitonomy/gitlib. Start by instantiating a GitRepository object pointing to an existing local Git repo path:
$repository = new GitRepository('/path/to/repo');
$history = $repository->getLog(); // Fetch commit history
First use case: programmatically inspect repository history, branches, or tags—ideal for CI dashboards, deployment tools, or Git GUIs built in PHP.
getLog(), getBranches(), getTags(), getDiff(), and getShortLog() to power audit trails or visualizations.GitAuditService) to avoid duplication.git gc, large diffs) without blocking HTTP requests.git commands fail silently or throw exceptions on invalid paths.LC_ALL=C or decode output manually if multilingual content is involved.execute() with callbacks instead of getOutput() for large logs to avoid memory exhaustion.Gitonomy\Git\Exception\ProcessException to access exit code, stdout, and stderr—vital for debugging misconfigured repos or permission issues.gitonomy/gitlib in a Laravel service provider to inject config (e.g., default timeout, bin path) and ensure testability via mocks in feature tests.How can I help you explore Laravel packages today?