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

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

ghostwriter/git
===============

PHP wrapper for Git commands.

0.1.3(3mo ago)0103.4k↓29.7%BSD-3-ClausePHPPHP ~8.4.0 || ~8.5.0CI passing

Since Jan 25Pushed 1mo agoCompare

[ Source](https://github.com/ghostwriter/git)[ Packagist](https://packagist.org/packages/ghostwriter/git)[ Docs](https://github.com/ghostwriter/git)[ GitHub Sponsors](https://github.com/sponsors/ghostwriter)[ RSS](/packages/ghostwriter-git/feed)WikiDiscussions 0.1.x Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (17)Used By (0)

Git
===

[](#git)

[![GitHub Sponsors](https://camo.githubusercontent.com/7a624141f8cdacf2ca49ea8aa9386e1322b072c644c92d54fb5a57ec90a36efc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f67686f73747772697465723f6c6162656c3d53706f6e736f722b4067686f73747772697465722f676974266c6f676f3d4769744875622b53706f6e736f7273)](https://github.com/sponsors/ghostwriter)[![Automation](https://github.com/ghostwriter/git/actions/workflows/automation.yml/badge.svg)](https://github.com/ghostwriter/git/actions/workflows/automation.yml)[![Supported PHP Version](https://camo.githubusercontent.com/733802ac2e5135da6e8ed3a4941904aff0fd22e5f9b680339f28ec447cf1a6c3/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f67686f73747772697465722f6769743f636f6c6f723d383839326266)](https://www.php.net/supported-versions)[![Downloads](https://camo.githubusercontent.com/dce1472121b871c75e0f832fe83b5e87e6d86f73538ffb9f5a5d71daa41f9dad/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f67686f73747772697465722f6769743f636f6c6f723d626c7565)](https://packagist.org/packages/ghostwriter/git)

PHP wrapper for Git commands

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

[](#installation)

You can install the package via composer:

```
composer require ghostwriter/git
```

### Star ⭐️ this repo if you find it useful

[](#star-️-this-repo-if-you-find-it-useful)

You can also star (🌟) this repo to find it easier later.

Usage
-----

[](#usage)

```
use Ghostwriter\Git\Git;

$environmentVariables = [
    'GIT_AUTHOR_NAME'  => 'Nathanael Esayeas',
    'GIT_AUTHOR_EMAIL' => 'nathanael.esayeas@protonmail.com',
];

$git = Git::new('/path/to/repo', $environmentVariables);
$git->init();
$git->add('file.txt');
$git->commit('-m', 'Initial commit');
$git->push('origin', 'main');

// Cloning a repository
$git->clone('git@github.com:ghostwriter/git.git', '--depth=1', '/path/to/clone');

// Each cloned repository should be managed with its own Git instance as follows:
$environmentVariables['GIT_AUTHOR_NAME'] = 'ghostwriter';
$environmentVariables['GIT_AUTHOR_EMAIL'] = 'ghostwriter@users.noreply.github.com';

$clonedGit = Git::new('/path/to/clone', $environmentVariables);
$clonedGit->status();
```

### Credits

[](#credits)

- [Nathanael Esayeas](https://github.com/ghostwriter)
- [All Contributors](https://github.com/ghostwriter/git/contributors)

### Changelog

[](#changelog)

Please see [CHANGELOG.md](./CHANGELOG.md) for more information on what has changed recently.

### License

[](#license)

Please see [LICENSE](./LICENSE) for more information on the license that applies to this project.

### Security

[](#security)

Please see [SECURITY.md](./SECURITY.md) for more information on security disclosure process.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance85

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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 ~10 days

Total

7

Last Release

54d ago

Major Versions

0.2.x-dev → 1.0.x-dev2026-01-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/1dbb0131801cc451dad9917ab29aa823b25d7eebc9f3875a9d481d109bdb44ee?d=identicon)[ghostwriter](/maintainers/ghostwriter)

---

Top Contributors

[![ghostwriter](https://avatars.githubusercontent.com/u/9754361?v=4)](https://github.com/ghostwriter "ghostwriter (189 commits)")

---

Tags

gitghostwriter

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[czproject/git-php

Library for work with Git repository in PHP.

5544.9M81](/packages/czproject-git-php)[cypresslab/gitelephant

An abstraction layer for git written in PHP

6131.0M23](/packages/cypresslab-gitelephant)[bruli/php-git-hooks

Git hooks for PHP projects.

675370.8k5](/packages/bruli-php-git-hooks)[marcocesarato/php-conventional-changelog

Generate changelogs and release notes from a project's commit messages and metadata and automate versioning with semver.org and conventionalcommits.org

2511.3M109](/packages/marcocesarato-php-conventional-changelog)[ramsey/conventional-commits

A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook action!

1931.2M122](/packages/ramsey-conventional-commits)[sebastianfeldmann/git

PHP git wrapper

466.9M18](/packages/sebastianfeldmann-git)

PHPackages © 2026

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