Find the current git version without using exec

v1.0.0 2017-04-09 09:12 UTC

This package is not auto-updated.

Last update: 2020-10-17 06:39:14 UTC


Control Alt

This package can be used to find the latest git tag. This can be used in various ways, IE for cache busting of your assets. It does not use exec, shell_exec, etc. It tries to read the files in your .git folder and retrieve the version from that.


composer require controlaltdelete/git-version


If the .git folder is the same folder as where the incoming request is made:

$version = \ControlAltDelete\GitVersion::find();

If the .git folder is somewhere else:

$version = \ControlAltDelete\GitVersion::find('path/to/.git/folder');