This is a simple git wrapper created for use in other php libraries.
It uses magic methods to execute commands, however it is extendable.
Add this to your composer file:
{
"require": {
"chrishalbert/git": "1.*"
}
}
Or simply on the command line:
composer require chrishalbert/git
$git = new Git();
$branches = $git->branch();
// Fix a file for all branches
foreach ($branches as $branch) {
$git->checkout($branch);
// Do stuff
$git->add('.');
$git->commit(['--message' => 'Fixed a bug']);
}
$git->checkout('master');