Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hnhdigital-os/laravel-git-info

Provides a wrapper for getting info from GIT.
https://github.com/hnhdigital-os/laravel-git-info

Last synced: 15 days ago
JSON representation

Provides a wrapper for getting info from GIT.

Awesome Lists containing this project

README

        

# GIT Info

This package has been developed by H&H|Digital, an Australian botique developer. Visit us at [hnh.digital](http://hnh.digital).

[![Latest Stable Version](https://poser.pugx.org/hnhdigital-os/laravel-git-info/v/stable.svg)](https://packagist.org/packages/hnhdigital-os/laravel-git-info) [![Total Downloads](https://poser.pugx.org/hnhdigital-os/laravel-git-info/downloads.svg)](https://packagist.org/packages/hnhdigital-os/laravel-git-info) [![Latest Unstable Version](https://poser.pugx.org/hnhdigital-os/laravel-git-info/v/unstable.svg)](https://packagist.org/packages/hnhdigital-os/laravel-git-info) [![License](https://poser.pugx.org/hnhdigital-os/laravel-git-info/license.svg)](https://packagist.org/packages/hnhdigital-os/laravel-git-info)

[![Build Status](https://travis-ci.org/hnhdigital-os/laravel-git-info.svg?branch=master)](https://travis-ci.org/hnhdigital-os/laravel-git-info) [![StyleCI](https://styleci.io/repos/65619816/shield?branch=master)](https://styleci.io/repos/65619816)

Provides a wrapper for getting info from GIT.

## Install

Via composer:

`$ composer require hnhdigital-os/laravel-git-info ~1.0`

### Laravel configuration

Enable the facade by editing config/app.php:

```php
'aliases' => [
...
'Git' => Bluora\LaravelGitInfo\Facade::class,
...
];
```

The service provider will autoload from Laravel 5.5.

To enable the service provider in versions prior to Laravel 5.4, edit the config/app.php:

Enable the service provider by editing config/app.php:

```php
'providers' => [
...
Bluora\LaravelGitInfo\ServiceProvider::class,
...
];
```

## Usage

### Laravel

Current version. Eg 'de83088-dirty'.

```php
echo Git::version();
```

Current branch. Eg 'master'.

```php
echo Git::branch();
```

Current total commits. Eg 7.

```php
echo Git::commits();
```

Commit difference between current branch and master.

Optional arguments include specifying a branch and returning a text version.

```php
echo Git::commitsBehind($branch = 'master', $return_text = true);
```

Show the status of the submodules.

```php
echo Git::submoduleStatus();
```

### PHP

```php
use Bluora\LaravelGitInfo\GitInfo;

echo (new GitInfo())->version();
```

## Contributing

Please see [CONTRIBUTING](https://github.com/hnhdigital-os/laravel-git-info/blob/master/CONTRIBUTING.md) for details.

## Credits

* [Rocco Howard](https://github.com/therocis)
* [All Contributors](https://github.com/hnhdigital-os/laravel-git-info/contributors)

## License

The MIT License (MIT). Please see [License File](https://github.com/hnhdigital-os/laravel-git-info/blob/master/LICENSE) for more information.