Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.03 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.03 KB

PHP Git

This package contains a php wrapper around the git cli, it is based on symfony/process and strictly typed.

Type Coverage Latest Stable Version License

Installation

composer require michaelpetri/php-git 

Example

$file = File::from('/home/mpetri/PhpstormProjects/php-git/README.md');

$repository = new GitRepository(
    $file->directory,
    Directory::from('/home/mpetri/PhpstormProjects/php-git/.git'),
    Duration::inSeconds(60)
);

$repository->add($file);
$repository->commit('Initial commit')

See GitRepositoryInterface or Tests for an overview of all available methods.