Skip to content

chrishalbert/Git

Repository files navigation

Git

Build Status Coverage Status Latest Stable Version License

Overview

This is a simple git wrapper created for use in other php libraries.

It uses magic methods to execute commands, however it is extendable.

Installation

Add this to your composer file:

{
    "require": {
        "chrishalbert/git": "1.*"
    }
} 

Or simply on the command line:

composer require chrishalbert/git

Usage

$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');