Skip to content

A library which provides fast execution and use git commands in your project

License

Notifications You must be signed in to change notification settings

biurad/php-git-scm

Repository files navigation

The Poakium Git-SCM

Latest Version Software License Code Maintainability Coverage Status Quality Score


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.

📦 Installation

PHP 8.0 or newer and GIT 2.30 or newer are required. The recommended way to install, is by using Composer. Simply run:

$ composer require biurad/git-scm

📍 Quick Start

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

📓 Documentation

In-depth documentation on how to use this library can be found at docs.biurad.com. It is also recommended to browse through unit tests in the tests directory.

🙌 Sponsors

If this library made it into your project, or you interested in supporting us, please consider donating to support future development.

👥 Credits & Acknowledgements

📄 License

Git SCM is completely free and released under the BSD 3 License.

About

A library which provides fast execution and use git commands in your project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages