PHPackages                             michaelpetri/php-git - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. michaelpetri/php-git

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

michaelpetri/php-git
====================

Simple wrapper around git cli, based on symfony/process.

0.5.1(3y ago)26.4k[4 PRs](https://github.com/michaelpetri/php-git/pulls)1MITPHPPHP ~8.1.0 || ~8.2.0

Since Mar 20Pushed 1y ago2 watchersCompare

[ Source](https://github.com/michaelpetri/php-git)[ Packagist](https://packagist.org/packages/michaelpetri/php-git)[ RSS](/packages/michaelpetri-php-git/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (6)Versions (14)Used By (1)

PHP Git
=======

[](#php-git)

This package contains a php wrapper around the git cli, it is based on [symfony/process](https://github.com/symfony/process) and strictly typed.

[![Type Coverage](https://camo.githubusercontent.com/dfb832f0620ba240b6f39f0413e1276a4c2462d287fb77bbc27d2ed75973ce74/68747470733a2f2f73686570686572642e6465762f6769746875622f6d69636861656c70657472692f7068702d6769742f636f7665726167652e737667)](https://shepherd.dev/github/michaelpetri/php-git)[![Latest Stable Version](https://camo.githubusercontent.com/7f1c114c3752c781001acec62d2796735e34affc4760824dee717daa6fabd8b4/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c70657472692f7068702d6769742f76)](https://packagist.org/packages/michaelpetri/php-git)[![License](https://camo.githubusercontent.com/6bab95a846979684c3f1c79eb76cd90be33c45c279ef5f19de15bbb466929b51/68747470733a2f2f706f7365722e707567782e6f72672f6d69636861656c70657472692f7068702d6769742f6c6963656e7365)](https://packagist.org/packages/michaelpetri/php-git)

Installation
------------

[](#installation)

```
composer require michaelpetri/php-git
```

Example
-------

[](#example)

```
$file = File::from('/home/mpetri/PhpstormProjects/php-git/README.md');

$repository = new GitRepository(
    $file->directory,
    Directory::from('/home/mpetri/PhpstormProjects/php-git/.git'),
    Duration::inSeconds(60)
);

$repository->add($file);
$repository->commit('Initial commit')
```

See [GitRepositoryInterface](src/MichaelPetri/Git/GitRepositoryInterface.php) or [Tests](/tests) for an overview of all available methods.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

8

Last Release

1148d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4114292?v=4)[Michael Petri](/maintainers/michaelpetri)[@michaelpetri](https://github.com/michaelpetri)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (69 commits)")

---

Tags

php

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/michaelpetri-php-git/health.svg)

```
[![Health](https://phpackages.com/badges/michaelpetri-php-git/health.svg)](https://phpackages.com/packages/michaelpetri-php-git)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.0k](/packages/friendsofphp-php-cs-fixer)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k42](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k17.1k1](/packages/phpactor-phpactor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
