Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you handle developer individual files under version control?

Some files in our repository are individual to each developer. For example some developers use a local database, which is configured in a properties file in the project. So each developer has different settings. When one developer commits, he always has to take care to not commit his individually configured files.

How do you handle this?

like image 716
cretzel Avatar asked Sep 22 '08 17:09

cretzel


People also ask

What is the problem with keeping data files in version control?

Generated files can bloat the version control history (the size of the database that is stored in the repository). A small change to a source file may result in a rather different generated file. Eventually, this affects performance of the version control system.

How do I add files to version control?

Add files to VCSOpen the Commit tool window Alt+0 . Put any files in the Unversioned Files changelist under version control by pressing Ctrl+Alt+A or selecting Add to VCS from the context menu. You can either add the entire changelist, or select separate files.


2 Answers

Our properties files are under a "properties" directory. Each developer has their own "username.properties" files which they can override properties in the environment-specific files such as "dev.properties", or "test.properties". This takes advantage of ANT's immutable properties (include personal first, THEN environment properties).

like image 89
DustinB Avatar answered Oct 05 '22 22:10

DustinB


Keep a set of defaults in source control and then either:

  • have each developer have an optional set of configs that they manage themselves (eg. not kept in source control) or

  • have each developer keep their own configs in source control under some sort of identification scheme (username.properties like @Dustin uses)

The advantage of keeping the developer's specific configs in source control makes it easy to migrate from one computer to another (eg. in the case of a hardware failure or upgrade). Its a simple svn co [repos] and ant

like image 45
Chris Gow Avatar answered Oct 05 '22 23:10

Chris Gow