PHPackages                             peej/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. peej/git

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

peej/git
========

An OO wrapper for Git allowing use of a Git repo as if it were a filesystem or database.

122793[1 issues](https://github.com/peej/git/issues)[1 PRs](https://github.com/peej/git/pulls)PHP

Since May 3Pushed 10y ago3 watchersCompare

[ Source](https://github.com/peej/git)[ Packagist](https://packagist.org/packages/peej/git)[ RSS](/packages/peej-git/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Git
===

[](#git)

An OO wrapper for Git allowing use of a Git repo as if it were a filesystem or database.

Talks directly to a Git repo via the Git binary, does not require a working copy or writing files to disk so it also works with a bare repo.

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

[](#installation)

Install via [Composer](http://getcomposer.org/), add a dependency on `peej/git` to your project's `composer.json` file.

```
{
    "require": {
        "peej/git": "1.0.*"
    }
}

```

Requirements
------------

[](#requirements)

A system with [git](http://git-scm.com/) installed, it is expected to be in the command path.

Usage
-----

[](#usage)

```
$repo = new Git\Repo('/tmp/myrepo.git');

// get head commit message
echo $repo->commit()->message;

// get a file from the head
echo $repo->file('mydir/myfile.txt');

// get the latest commit the file was mentioned in
$commit = $repo->file('mydir/myfile.txt')->history[0];

// get a tree for a given path
$tree = $repo->tree('mydir');
echo $tree['myfile.txt'];

// stage a file edit
$repo->update('mydir/myfile.txt', 'new content');

// create a new commit
$repo->save('commit message');

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.8% 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://avatars.githubusercontent.com/u/2858?v=4)[Paul James](/maintainers/Peej)[@peej](https://github.com/peej)

---

Top Contributors

[![peej](https://avatars.githubusercontent.com/u/2858?v=4)](https://github.com/peej "peej (45 commits)")[![wseng](https://avatars.githubusercontent.com/u/6572161?v=4)](https://github.com/wseng "wseng (4 commits)")

### Embed Badge

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

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

PHPackages © 2026

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