PHPackages                             winternet-studio/php-parse-git-commands - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. winternet-studio/php-parse-git-commands

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

winternet-studio/php-parse-git-commands
=======================================

PHP parsers and formatters for output from Git commands

01PHP

Since Oct 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/winternet-studio/php-parse-git-commands)[ Packagist](https://packagist.org/packages/winternet-studio/php-parse-git-commands)[ RSS](/packages/winternet-studio-php-parse-git-commands/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-parse-git-commands
======================

[](#php-parse-git-commands)

PHP parsers and formatters for output from Git commands, eg. `git show`

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

[](#installation)

Using [composer](https://getcomposer.org/) install the [composer package](https://packagist.org/packages/winternet-studio/php-parse-git-commands "This package on packagist.org"):

```
composer require winternet-studio/php-parse-git-commands dev-main

```

Example
-------

[](#example)

```
// Get the output from the `git show` command
$output = [];
exec('git show -999', $output);
$output = implode("\n", $output);

// Parse it
$parser = new \winternet\phpGit\GitShow();
$parsedData = $parser->parse($output);
```

`$parsedData` will now contain an array of commits, eg.:

```
[
    {
        "hash": "65ee18011b6cd82b86480e983c918b5581af16e2",
        "author": "John Doe ",
        "timestamp": "Mon Nov 25 07:57:48 2019 +0100",
        "message": "Some changes, etc\n\nFurther description",
        "unifiedDiff": "diff --git a/about.php b/about.php\nindex 8c7481d..037fa59 100644\n--- a/about.php\n+++ b/about.php\n@@ -1 +1,4 @@\n-This is an About Us page\n+This is an About us page\n+laksdfkajsdf\n+lasjldkfjasdf\n+laskdjfsd\ndiff --git a/index.php b/index.php\nindex 22d90cd..9f87cd5 100644\n--- a/index.php\n+++ b/index.php\n@@ -5,3 +5,5 @@ echo 'Date: '. date('Y-m-d H:i') .'';\n function nice_little_function() {\n \treturn 5 * 6;\n }\n+\n+echo nice_little_function();\n\n"
    }
]
```

If you want to parse the unified diff you could use [ptlis/diff-parser](https://github.com/ptlis/diff-parser).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9f1fc794b057a39ce03adf6ac3adab535df3633b7792d0eb064306dff91eafc?d=identicon)[winternet](/maintainers/winternet)

---

Top Contributors

[![winternet-studio](https://avatars.githubusercontent.com/u/5200270?v=4)](https://github.com/winternet-studio "winternet-studio (3 commits)")

### Embed Badge

![Health badge](/badges/winternet-studio-php-parse-git-commands/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M282](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M343](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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