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
- REPOSITORY: Official recommendation is to have three folders/subdirectories under the Project Root - “trunk”, “branches” and “tags”.
- COMMIT WISELY: Commit to reflect a single purpose.
- ISSUE-TRACKER: Create 2-way links between Subversion changesets and issue-tracking database.
- TRACK MERGES MANUALLY: Write descriptive log message that explains your merge.
WHEN, WHAT AND WHY TO BRANCH, TAG
- 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.
- 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.
- 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.