norwichtech/php-git-branch

Library for working out which git branch you are on in PHP

This package's canonical repository appears to be gone and the package has been frozen as a result.

1.1.2 2017-09-27 10:52 UTC

This package is not auto-updated.

Last update: 2020-11-28 10:04:12 UTC


README

What git branch am I on? What does it all mean? This library may answer one of more of these big burners.

Usage:

include('../vendor/autoload.php');

$currentFolder = realpath(dirname(__FILE__)."/../");

$fileWrapper = new \NorwichTech\FileWrapper\FileWrapper;

$gitBranch = new \NorwichTech\PHPGitBranch\GitBranch($currentFolder,$fileWrapper);

$branch = $gitBranch->branch;

echo "This repository is currently working in \033[0;34m[".$branch."]\033[0;39m branch\n";