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 1mo ago

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 72% of packages

Maintenance29

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

1103d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74dcb48accd64ea1dd40d20cddc713f68805da8c3281da7369eba28c64d4e62e?d=identicon)[michaelpetri](/maintainers/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

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[spatie/typescript-transformer

This is my package typescript-transformer

3706.5M16](/packages/spatie-typescript-transformer)[civicrm/civicrm-core

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

728272.9k20](/packages/civicrm-civicrm-core)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[eclipxe/cfdiutils

PHP Common utilities for Mexican CFDI 3.2, 3.3 &amp; 4.0

141129.9k6](/packages/eclipxe-cfdiutils)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)

PHPackages © 2026

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