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

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

innmind/git
===========

Git abstraction

5.0.0(3mo ago)141.4k11MITPHPPHP ~8.4CI passing

Since Nov 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Innmind/Git)[ Packagist](https://packagist.org/packages/innmind/git)[ Docs](http://github.com/Innmind/Git)[ RSS](/packages/innmind-git/feed)WikiDiscussions develop Synced 1w ago

READMEChangelog (6)Dependencies (5)Versions (22)Used By (1)

Git
===

[](#git)

[![CI](https://github.com/Innmind/Git/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Innmind/Git/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/fa829ffc11a7034fadd9682118a44d08b06950b0b9bc09a459d5477a7cf8aa72/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f6769742f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/git)[![Type Coverage](https://camo.githubusercontent.com/95350e0090570254584ba60ef5c1977101fe1aaf933680d8a1672d3f95d5f266/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f6769742f636f7665726167652e737667)](https://shepherd.dev/github/innmind/git)

Abstraction layer to manipulate local git repositories.

Feel free to submit a PR to add other git functionalities.

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

[](#installation)

```
composer require innmind/git
```

Usage
-----

[](#usage)

```
use Innmind\Git\{
    Git,
    Repository\Remote\Name,
    Repository\Remote\Url,
    Revision\Branch,
};
use Innmind\OperatingSystem\Factory;
use Innmind\Url\Path;

$os = Factory::build();
$git = Git::of($os->control(), $os->clock());
$repository = $git
    ->repository(Path::of('/somewhere/on/the/local/machine'))
    ->unwrap();
$_ = $repository
    ->init()
    ->unwrap();
$remotes = $repository->remotes();
$remotes
    ->add(Name::of('origin'), Url::of('git@github.com:Vendor/Repo.git'))
    ->unwrap();
$remotes
    ->get(Name::of('origin'))
    ->push(Branch::of('master'))
    ->unwrap();
$repository
    ->branches()
    ->new(Branch::of('develop'))
    ->unwrap();
$repository
    ->checkout()
    ->revision(Branch::of('develop'))
    ->unwrap();
```

This example initialize a local git repository, declare a github repository as its remote and finally checkout the new branch `develop`.

The offered functionalities goes beyond this single example, check the classes' api to discover all of them.

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.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.

###  Release Activity

Cadence

Every ~177 days

Recently: every ~333 days

Total

18

Last Release

92d ago

Major Versions

1.4.0 → 2.0.02020-02-01

2.2.1 → 3.0.02022-06-05

3.2.0 → 4.0.02025-08-09

4.0.0 → 5.0.02026-02-15

PHP version history (7 changes)1.0.0PHP ~7.1

1.4.0PHP ~7.2

2.0.0PHP ~7.4

2.1.0PHP ~7.4|~8.0

3.0.0PHP ~8.1

3.2.0PHP ~8.2

5.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (134 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (2 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

git

### Embed Badge

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

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

###  Alternatives

[innmind/object-graph

Extract object graph out of a root object

242.8k7](/packages/innmind-object-graph)[mremi/contact-bundle

Implementation of a contact form for Symfony2

2712.4k2](/packages/mremi-contact-bundle)[tlr/html-table-builder

An HTML Table Builder

1040.1k](/packages/tlr-html-table-builder)[phpstrap/phpstrap

Bootstrap layout generator

1214.7k](/packages/phpstrap-phpstrap)

PHPackages © 2026

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