grynn/git

A simple wrapper for git (depends on the git executable). Supports subset of commands useful for versioning projects

v0.0.3 2015-01-26 01:09 UTC

This package is not auto-updated.

Last update: 2024-04-13 14:23:52 UTC


README

Simple PHP wrapper for Git (depends on git executable being in the path). Very limited feature set. Mainly for use with Grynn\GitVersionBump

Installation

To add this package as a local, per-project dependency to your project, simply add a dependency on grynn/git to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on Grynn\Git 1.0:

{
    "require": {
        "grynn/git": "1.0.*"
    }
}

Usage

$git = new \Grynn\Git();
$git->getCurrentBranch();   //Returns: branchname
$git->isDirty();            //Returns: true if working dir is dirty
$git->getVersionTag();       //Returns: version tag that describes current HEAD