I used to work on the
trunk because for all the projects I worked on, it's either I was the sole developer or the team ensured that everyone code check-in has passed the local tests. Otherwise, we created (we still) branches for bug fixes, large code for new features, etc.
About 2 months ago, I had a short
git session with
Kamal and he shared with me the idea of
story/branch. And as my team started to grow with more dev guys, I feel the need of encouraging more branching and now this has become a rule. For a project with automated tests defined with CI set up, a stable trunk is guaranteed and this practice can fit very well into it.
We don't use git but
Subversion because that's how we started and we are still comfortable with it now (most of the time).
If you have a working copy on trunk, here're some simple steps to switch to a branch (
svn switch won't work):
svn cp https://repo/trunk https://repo/branches/module-version-storyname
cd /path/to/trunk/working/copy
svn diff > /tmp/diff
svn co https://repo/branches/module-version-storyname
cd module-version-storyname
patch -p0 < /tmp/diff