oliveris / git-version
Gets the git version and returns it as a string.
Installs: 636
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
This package is auto-updated.
Last update: 2025-03-18 03:41:33 UTC
README
Helpers around Git Tag versions these include getting the latest version and getting the date of the version.
Usage
Pull in the composer package by running the command below:
composer require oliveris/git-version
Import the namspace into the class (autoloading)
use GitVersion\GitVersion
Examples
To get the latest git version string
Below is an example that returns a string of the git version.
GitVersion::getLatestVersion()
To get the date a git version was created at
Below is an example that returns a date string the passed version tag was created at. The optional second parameter is a date format you need it to return as.
// Get the version you require
$git_version = GitVersion::getLatestVersion()
// Get the date for that version
GitVersion::getVersionDate($git_version, 'd-m-Y')
Tests
To run the tests set up the package in an environment you can run php and open tests/index.php
Built With
- PHP
Versioning
We use Semantic Versioning 1.0.0, for example v1.0.0.
Authors
- Sam Oliveri - Software Developer
License
GIT Version is open-sourced software licensed under the MIT license.