Managing Generated / Derived Files in Github Registry
There are a lot of derived files in my project, files created by others, so they are really duplicated. Examples:
Transpiling: I am using either coffeescript or es6 / babel to convert the source to .js files, which are redundant as they are easily recreated from CS / ES6 files.
Binding. Derived .js files are preprocessed (uglify, etc.) and then placed in myproject.js and myproject.min.js files for easy download from github.
Documentation: I use Docco to generate HTML documentation for each source file, so redundant. The original comments create the documentation.
I would prefer the repo to be tiny and have no derivative files.
One thought is using gh pages for a complete set of files, using .gitignore to skip derivatives for master, but having separate .gitignore gh pages to allow all derived files. Seems a bit extreme though.
Is there a way (standard, better way) to manage derived files? They can be misleading to git - make pull / merge / fetch report conflicts in derived files that we don't need, a clean full build is always correct.
source to share
Add .gitignore to your gitrepo root folder: here
For a specific build type (like coffeescript) google "coffeescript gitignore" and you can usually find a template. I did it for coffeescript and found this: http://heyrod.com/snippet/s/gitignore-for-coffee.html
EDIT
I didn't get the complexity from your question.
I think I understand now. You can try using the .gitattributes attributes to always select "our" or them when merging: How do I tell git to always select the local version for conflicting merges in a specific file?
source to share