in Technology

Subversion Best Practices – Quick Notes

I was trying to know a bit more about Subversion folder management myself. While looking around, I found a quick and to-the-point article at Subversion Best Practices. I decided to profile a Quick-View version for my reference.

BASIC

  1. REPOSITORY: Official recommendation is to have three folders/subdirectories under the Project Root – “trunk”, “branches” and “tags”.
  2. COMMIT WISELY: Commit to reflect a single purpose.
  3. ISSUE-TRACKER: Create 2-way links between Subversion changesets and issue-tracking database.
  4. TRACK MERGES MANUALLY: Write descriptive log message that explains your merge.


WHEN, WHAT AND WHY TO BRANCH, TAG

  1. NEVER BRANCH: Small project, small team. It is easy to follow, have low barrier to entry but this is a chaotic development, might break /trunk often.
  2. ALWAYS BRANCH: Big team, Big project, dedicated management and supervision. The /trunk remains safe and is always the stable version but this will isolate coders from one another, sometimes can create conflicts and requires users to know how to use SVN effectively with extra merging lessons.
  3. BRANCH WHEN NEEDED: Perhaps the best and my favorite. The /trunk is still the stable version, branches and tags are created as and when required. However, this needs a bit more work in managing the SVN and a sync between developers. Lots of testing before merging, committing.


SO …

  • Main branch is of course the /trunk
  • Create branches at /branches/~theBranches to work separately off the main trunk and merge later.
  • Tag out releases or major versions etc at /tags/~theTags

UPDATES

1st Oct, 2007: Kalid Azad has A Visual Guide to Version Control.