Git: saving but not pulling LESS files

I recently started working with LESS and since I did some research for automated developers like Jenkins and Grunt it seemed like the general advice was not to store LESS files on the repo or have them on a real server, just compiled CSS ...

So, I was hoping to get some advice on this. It appears that since LESS files are part of the project, storage is necessary. But it makes sense not to have extra random files on the real server. Removing them themselves seems like the wrong way to do it every collection, plus a lot of time. I am guessing I can get automatic pickers to do this for me, although I don't know how to do it yet. The most direct way would seem to be not to shoot them down in the first place.

Or am I thinking the opposite? Should I have a different file medium for storing LESS files and others? I no longer store my PDFs in the repo, should I treat LESS the same way? How are these files stored?

+3


source to share


1 answer


The conflict arises from the aggregation of version control and release control: you are using the same link:

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

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



I would prefer:

  • push to bare repo
  • there is a hook after taking that:
    • check that the bare repo in the target folder (live site)
    • build compiled css (compressed with lessc)
    • delete fewer and fewer files
+1


source







All Articles