Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Maxim Andreev
Maxim Andreev
24,529 Points

Sass GIT best practices

Hi,

When creating a project (e.g. Django), what is the best way to include Sass files in my VCS.

Do I create a separate Git repo for Sass and then add the generated CSS files to the website repo?

Or do I just include the Sass files in the website repo and then just convert them to CSS files once I pull the repo to the website server. (.gitignore the CSS files completely)

Thanks!

1 Answer

I think it's best to only include the Sass source files (*.scss, *.sass and a config.rb file), list Sass as a requirement/dependency for the project, and ensure the correct files are in the .gitignore file:

.sass-cache/
*.css.map

Then a user who clones/downloads your repository will just run the Sass compiler on their local machine/server.

Providing instructions on how to do that is also really helpful (throw it in the readme.md file in the project root).