TK.
TK.

Reputation: 28193

SASS files management in Git version control system in Ruby on Rails

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.

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.

Upvotes: 3

Views: 1349

Answers (3)

Paweł Gościcki
Paweł Gościcki

Reputation: 9624

You should not commit the generated CSS files into Git and to deal with read-only filesystems (like Heroku) you should use the hassle gem (the sass_on_heroku plugin is now deprecated).

Upvotes: 1

Justin Workman
Justin Workman

Reputation: 698

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.

Upvotes: 2

Ben
Ben

Reputation: 6965

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/

Upvotes: 2

Related Questions