PHPackages                             emileperron/git-version-strategy-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. emileperron/git-version-strategy-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

emileperron/git-version-strategy-bundle
=======================================

A custom version strategy for Symfony assets that uses the current Git commit short-hash as the version identifier.

v1.0.1(3y ago)06012[1 issues](https://github.com/EmilePerron/git-version-strategy/issues)MITPHP

Since Apr 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/EmilePerron/git-version-strategy)[ Packagist](https://packagist.org/packages/emileperron/git-version-strategy-bundle)[ GitHub Sponsors](https://github.com/EmilePerron)[ RSS](/packages/emileperron-git-version-strategy-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Symfony asset versioning based on Git
=====================================

[](#symfony-asset-versioning-based-on-git)

This is a small Symfony bundle that implements a custom version strategy which uses the current Git commit short-hash as the version identifier.

This will turn the URL of your assets from this:

```
/css/style.css

```

to

```
/css/styles.css?v=b4703f8

```

This will ensure that you assets always match the current version of your project by eliminating browser caching issues.

---

Getting started
---------------

[](#getting-started)

To get started, add the bundle to your project using Composer, like so:

```
composer require emileperron/git-version-strategy-bundle
```

Then, in your `config/bundles.php` file, include the bundle like so:

```
