Version Control Repository Structure January 15th, 2008
We noticed a project in our repository by a former developer. Its trunk was empty, but it had six branches. Yes, six. Six, six, six, six. Time for an introduction to repositories!
The Folders
A subversion repository, by convention, has the following folders.
Trunk
You put your app's code in trunk. You do development in trunk.
Branches
When you're making a significant change:
- Duplicate trunk and put it in the branches folder.
- Do development on the new branch.
- Merge the branch back to trunk.
- Delete the branch.
Tags
If you need an unchanging snapshot of code for when, say, you release 1.0, you put it in your /tags folder.
This isn't brain surgery
These are universal concepts. Different version control systems, like Git, represent branches differently (read: better), but it's the same idea. Maybe he was confused since subversion treats branches as just another folder. Maybe nobody taught him the finer points of version control.
Then I see-- in spite of our repeated lessons on test-driven-development-- this project has zero test coverage.
Never have I been happier with the word "former".
Sorry, comments are closed for this article.