GIT Info
This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital., (*1)
, (*2)
, (*3)
Provides a wrapper for getting info from GIT., (*4)
Install
Via composer:, (*5)
$ composer require hnhdigital-os/laravel-git-info ~1.0, (*6)
Laravel configuration
Enable the facade by editing config/app.php:, (*7)
'aliases' => [
...
'Git' => Bluora\LaravelGitInfo\Facade::class,
...
];
The service provider will autoload from Laravel 5.5., (*8)
To enable the service provider in versions prior to Laravel 5.4, edit the config/app.php:, (*9)
Enable the service provider by editing config/app.php:, (*10)
'providers' => [
...
Bluora\LaravelGitInfo\ServiceProvider::class,
...
];
Usage
Laravel
Current version. Eg 'de83088-dirty'., (*11)
echo Git::version();
Current branch. Eg 'master'., (*12)
echo Git::branch();
Current total commits. Eg 7., (*13)
echo Git::commits();
Commit difference between current branch and master., (*14)
Optional arguments include specifying a branch and returning a text version., (*15)
echo Git::commitsBehind($branch = 'master', $return_text = true);
Show the status of the submodules., (*16)
echo Git::submoduleStatus();
PHP
use Bluora\LaravelGitInfo\GitInfo;
echo (new GitInfo())->version();
Contributing
Please see CONTRIBUTING for details., (*17)
Credits
License
The MIT License (MIT). Please see License File for more information., (*18)