views:

196

answers:

2

I'm using SASS files in Rails development. And I wonder if I should gitignore generated CSS files.

The problem with adding CSS files in Git is that they are simply redundant. SASS files at public/stylesheets/sass are the files I need.

So I have the following lines in gitignore:

# public/stylesheets/*.css

But if I do this, when I push my app to Heroku, there's no CSS files obviously.

  • What could be the best practices for managing SASS/CSS files?

I have never tried assets packing (e.g., minifying CSS files for production environment), but I plan to do that as well when I deploy to non-Heroku environment with Capistrano.

+2  A: 

Here's a heroku blog post about their plugin to generate CSS from your Sass on their servers. http://blog.heroku.com/archives/2009/8/18/heroku_sass/

Ben
You might have forgot the URL to the blog post.
TK
I forgot to do the link reference thing. Thanks.
Ben
A: 

My method is to keep a dedicated local branch to track everything that will be pushed to Heroku. Your mileage may vary, but this works well for me and feels pretty cleanly organized.

Justin Workman
I like this approach, but it's not easy for most folks to pull off. Maybe you can blog about how you did it and post a link here for posterity?
chriseppstein