Version Control – How Should Code in Version Control Be Stored?

version control

How should code in version control be stored?

Developer friendly? so that programmer can quickly take the latest and able to run from his editor without doing many changes? (like config files pointing to dev DB..etc)

or

Should it be production friendly? source should be in a manner which is easy to deploy on production environment and when developer takes the latest, he should perform changes as per his development needs.

Best Answer

Why choose ? It should be both.

Your development environment should be configured so it's as easy as doing a checkout, open, build, run, debug (eg: no absolute path!). You can do that easily with compilation directives, configuration class + dependancy injection, or even tricks like the perso.config in ASP.NET

Your automated build script should be customized enought to take care of specific production configuration, clean up, packaging etc.