Only store the canonical stuff

People sometimes ask us what kind of things can be stored in a repository.  In general, the answer is: “Any file”.  It is true that this book is focused on tools which are designed for software developers. However, any modern VCS doesn’t really care about what kinds of files it is asked to store.

Although you can store anything you want in a repository, that doesn’t mean you should. The best practice here is to store everything which is created manually, and nothing else. I call this “the canonical stuff”.

Do not store any file which is automatically generated. Store your hand-edited source code. Don’t store EXEs and DLLs. If you use a code generation tool, store the input file, not the generated code file. If you generate your product documentation in several different formats, store the original format, the one that you manually edit.

If you have two files, one of which is automatically generated from the other, then you just don’t need to store both of them. You would in effect be managing two expressions of the same thing. If one of them gets out of sync with the other, then you have a problem.