Library for working with Git repository & Git services in PHP.
This package is auto-updated.
Last update: 2023-11-22 10:23:43 UTC
A lightweight PHP library for working with Git Source Control Management (SCM). It is a simple, easy to use, and powerful tool for managing your Git repositories.
$ composer require biurad/git-scm
This library is just a simple wrapper for GIT shell commands and parses the output so you can use it in your PHP code. The performance is not as good as Git, but it is still fast enough to be used in production.
Here is an example of how to use the library:
use Biurad\Git; $repo = new Git\Repository('/path/to/repository'); $repo->commit(new Git\CommitNew( message: new Git\Commit\Message('My commit message'), author: $repo->getAuthor()->setDate('Tue, 06 Sep 2022 07:21:10') )); // Stage all changes and commit them $repo->getLog()->getCommits(); // Get all commits $repo->getLastCommit(); // Get the newest commit $branches = $repo->getBranches(); // Get all branches $tags = $repo->getTags(); // Gt all tags
If this library made it into your project, or you interested in supporting us, please consider donating to support future development.
- Alexandre Salomé developed the gitonomy/gitlib library which inspired this library.
- Divine Niiquaye Ibok is the author this library.
- All Contributors who contributed to this project.
Git SCM is completely free and released under the BSD 3 License.