Merging a branch back into the trunk with Subversion
I'm just getting the hang of using Subversion for version control and the workflow is starting to gel. One issue I came against yesterday was merging a branch back into the trunk. The process is a bit interesting.
- Copy your trunk to a branch
svn copy <a href="http://path.com/to/trunk" title="http://path.com/to/trunk">http://path.com/to/trunk</a> http://path.com/to/branch/example - Switch your working copy to the branch
- Check your URL with
svn info - Make changes to code
- Commit back to branch
svn ci -m "made my changes to branch example" - Switch your working copy back to TRUNK
- Merge the branch with the trunk on your working copy
svn merge <a href="http://path.com/to/trunk" title="http://path.com/to/trunk">http://path.com/to/trunk</a> <a href="http://path.com/to/branch/example" title="http://path.com/to/branch/example">http://path.com/to/branch/example</a> . - This only changes the working copy, now you need to commit your working copy to trunk
svn ci -m "Merged branch example into trunk"