Git: Storing but not pulling LESS files Git: Storing but not pulling LESS files jenkins jenkins

Git: Storing but not pulling LESS files


The conflict comes from aggregating source management and release management: you are using the same referential to:

  • store sources (from which you can build releases, included the compiled CSS files),
  • and to deploy (part of the release process)

The article "The Ideal LESS Workflow with git" suggests a pre-commit hook to make sure the css are always in sync with LESS changes, but that means storing generated content in the git repo itself.

I would rather:

  • push to a bare repo
  • have a post-receive hook which would:
    • checkout that bare repo in the target folder (the live site)
    • build the compiled css (compressed with lessc)
    • remove all less files