Question: In a project we're working on we're committing in the compiled CSS from our SASS. The only this is that we are starting to frequently get merge conflicts on these files.

The way we resolve this at the moment is just to clear the file out, and it is recompiled automatically from the correctly merged source SASS files.

What's the best way for us to avoid this, apart from adding those files to .gitignore? What I'm thinking the ideal solution is to set the merge strategy for that file (and that file one) to theirs/mine, but I'm not sure if this is possible.

Answer: 
If this (the Git repo) is considered as a *source* code repository, then you should add those recreated file type/names to your .gitignore file. That's because they aren't actual *source* files.

However, if you need the repo to keep certain derived results (to avoid tool update dependencies) then you may want to condider writing a special merge driver (see `merge.<driver>.name` config options, and git-attributes "Defining a custom merge driver")

It should be possible to associate the file type with the driver, etc.

I've not tried the latter so ... enjoy the reading the manual's depths
I'd use the smudge and clean filters([link to doc](http://git-scm.com/book/ch7-2.html)).

The goal is to basically exclude this file from merge actions and rebuild the file after checkout.

As "smudge" I'd empty the file (or insert a text stating that this file will be rebuild from file xyz).

As "clean" I'd rebuild the file from the original SASS.
This should work if the filenames of the css/sass files correlate somehow.

```
// %f passes the filename
// "rebuild_css"  and "clean_css" need to be written.
[filter "css"]
  clean = rebuild_css %f
  smudge = clean_css %f

```