Output git info over Twig.
This plugin requires:
- Craft CMS:
^5.0.0 - PHP:
^8.2 || ^8.3 || ^8.4 || ^8.5
composer require leowebguy/git-info -w && php craft plugin/install git-infoddev composer require leowebguy/git-info -w && ddev exec php craft plugin/install git-info{{ craft.git.branch }}→ Current branch (e.g.main,staging){{ craft.git.remoteUrl }}→ Remote URL (e.g.github.com:leowebguy/git-info.git){{ craft.git.lastTag }}→ Latest git tag (e.g.2.1.0){{ craft.git.commitHash }}→ Last commit hash{{ craft.git.commitAuthor }}→ Last commit author name{{ craft.git.commitDate }}→ Last commit date (YYYY/MM/DD HH:MM:SS)
{% if not craft.app.config.custom.isProd %}
<div style="position: fixed; bottom: 1rem; right: 1rem; padding: 6px 10px; text-align: right; border: solid 1px #eee; z-index: 999; background: #fff;">
{{ 'branch: ' ~ craft.git.branch }}<br>
{{ 'remote url: ' ~ craft.git.remoteUrl }}<br>
{{ 'last tag: ' ~ craft.git.lastTag }}<br>
{{ 'commit hash: ' ~ craft.git.commitHash }}<br>
{{ 'commit author: ' ~ craft.git.commitAuthor }}<br>
{{ 'commit date: ' ~ craft.git.commitDate }}
</div>
{% endif %}# Static analysis (PHPStan level 8)
composer phpstan
# Code style testing (Pint)
composer pint-test
# Code style formatting (Pint)
composer pint