ghostwriter / git
PHP wrapper for Git commands.
Fund package maintenance!
ghostwriter
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/ghostwriter/git
Requires
- php: ~8.4.0 || ~8.5.0
- ext-mbstring: *
- ghostwriter/container: ^6.0.1
- ghostwriter/filesystem: ^0.1.2
- ghostwriter/shell: ^0.1.4
Requires (Dev)
- ext-xdebug: *
- ghostwriter/coding-standard: dev-main
- mockery/mockery: ^1.6.12
- phpunit/phpunit: ^12.5.7
- symfony/var-dumper: ^8.0.4
- 1.0.x-dev
- 0.2.x-dev
- 0.1.x-dev
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-phar/composer/2.9.5
- dev-composer/update
- dev-phar/psalm/6.14.3
- dev-phar/phar-io/phive/0.16.0
- dev-phar/infection/0.32.3
- dev-phar/psalm/6.7.1
- dev-phar/phar-io/phive/0.15.3
- dev-phar/infection/0.29.14
- dev-phar/phpunit/12.5.8
- dev-composer/ghostwriter/coding-standard/dev-main
- dev-composer/phpunit/phpunit/12.5.8
- dev-merge-up/0.1.x-into-0.2.x
- dev-phar/composer-normalize/2.49.0
- dev-main
- dev-github/settings
- dev-phar/phpdocumentor/3.9.1
- dev-gitattributes
This package is auto-updated.
Last update: 2026-01-29 11:41:51 UTC
README
PHP wrapper for Git commands
Installation
You can install the package via composer:
composer require ghostwriter/git
Star ⭐️ this repo if you find it useful
You can also star (🌟) this repo to find it easier later.
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
Changelog
Please see CHANGELOG.md for more information on what has changed recently.
License
Please see LICENSE for more information on the license that applies to this project.
Security
Please see SECURITY.md for more information on security disclosure process.