I have a project with two versions of my code, one "maintenance" and one "new" for a newer version.

I wanted to ignore all \*.min.js files in my code in these branchs. Some .js files are in "new" but not in "maintenance". Eclipse generates .min.js everytime a .js file is edited. 

The problem is, when i'm on branch "new" and switch to branch "maintenance", the minified js generated in new and that don't have their .js files on maintenance are still there.

Is there a way to tell git to delete these files when switching to maintenance ?

I would like to defined a merge strategy in gitattributes instead of ignoring .min.js files, but Eclipse doesn't handle gitattriutes.