Version Control Policy: Best Practices

- 3 mins

Your code base is always under version control (if it’s not, it’s high time you did!), and developers are always scared about taking updates or committing files, under some supernatural fear, that an update will wipe out their local changes. This causes a lot of trouble in the team, when some developers have not updated their code base since a long time. I’ve compiled below a checklist of best practices.

Before you check in your code to subversion, here are a few points to follow.

Some best practices for not getting your code out of date.

If you have the count of red more than 0, then your repository has conflicting files.

Changesets

Most if the commits in the system span across sub-modules and generally contain multiple files. When “applying a patch”, “fixing a bug”, “adding a new features”. Always commit these group of files as one commit and not individual files, with the same comment!

Example: Jira ticket: ABC-123, introduced a new feature which involved changes in totality of 15 files, don’t commit the 15 files one by one, but commit them all together as one group (changeset) of 15 files with proper comments.

Every time you hit a commit, there is a new revision created. After committing 15 files separately you’ve created 15 versions (or changesets), and incase an issue occurs and you need to revert the changes, you’ll have to revert the revisions one by one. If these changes were done as a group, all you need to revert the one big changeset. Group commit also reduce the noise level and useless incrementing of revisions in SVN (any version control).

BUT, Each ticket needs to have its own commit changeset, not grouped with other tickets, unless there is a dependency between the tickets.

Further reading: http://subversion.tigris.org/faq.html#changesets

VARUN MEHTA

VARUN MEHTA

coder | engineer | tinkerer | photographer | cook | tryathlete

Schedule Meeting