Note: This web site is only kept up to date for OSG Software 1.2 (VDT 2.0.0). If you are looking for information for the most recent release, the RPM-based OSG Software 3.0, please see the OSG documentation web site

SVN Branching and Merging

For basic subversion usage and information about our repository, see this page.

In the below documentation, $SVN represents the svn root - currently that is at file:///p/vdt/workspace/svn/vdt.


To create a branch:

svn cp source dest

# For example, to branch 1.8.2 from the 1.8 branch
svn cp $SVN/vdt/branches/vdt-1.8 $SVN/vdt/branches/vdt-1.8.2


Tags should include the branch name, followed by an identifier.


Most of our lettered release merges apply smoothly. However, files/directories are renamed, there are additional steps needed. Here is an example of a complicated merge involving renamed files/dirs and some extra instructions. It is not important to read now, it is included here as a reference for those situations.

The following examples assume that the shell variable SVN is set to file:///p/vdt/workspace/svn. In csh-like shells:

setenv SVN file:///p/vdt/workspace/svn
In sh-like shells:
  1. If you are about to perform a merge, create a tag. If you just created a tag for a release, use that tag. If you did not do a release, and have not yet created a tag, do so now (look at the section above on tagging for help naming the tag). This helps keep track of where the last merge point was on a given branch. The tag will likely look something like:
    svn copy $SVN/vdt/branches/vdt-1.8.1-dcache $SVN/vdt/tags/vdt-1.8.1-dcache-merge1
  2. Get a checkout of the branch that you are going to merge into.
    svn co $SVN/vdt/trunk
    svn co $SVN/vdt/branches/BRANCH
  3. Determine what tags/branches you are merging between.
    • For lettered releases, this is usually the tag that was just created, and the previous release tag. For example, (vdt-1.8.0e and vdt-1.8.0f) or (vdt-1.8.1 and vdt-1.8.1a).
    • For merging changes on a branch back to the trunk, .... (fill this in)
  4. Run a dry run merge. From the checkout that you just made (of the branch you want to merge into):
    cd fresh-checkout-directory
    # Run the dry-run merge.  Note the . at the end of the command line.  This is where you are merging into.
    svn merge --dry-run $SVN/vdt/(branches|tags)/OLD $SVN/vdt/(branches|tags)/NEW .
    # e.g. svn merge --dry-run $SVN/vdt/tags/vdt-1.8.1 $SVN/vdt/tags/vdt-1.8.1a .
  5. Examine the changes that would be applied if this were actually doing the merge. Does everything look good? If not, you can do an 'svn diff' to see what changed.
    svn diff $SVN/vdt/(branches|tags)/OLD $SVN/vdt/(branches|tags)/NEW
    # Questions about a specific package that changed?
    svn diff $SVN/vdt/(branches|tags)/OLD/Package $SVN/vdt/(branches|tags)/NEW/Package
  6. All the changes look good? Now run the real merge. Same as above, without the --dry-run flag.
    svn merge $SVN/vdt/(branches|tags)/OLD $SVN/vdt/(branches|tags)/NEW .
  7. Watch for "Skipped missing target" messages. This means that the checkout you are in does not have the right directory/file to apply changes to. Handle appropriately. Here is an example involving directories changing names.
  8. Examine the changes, using 'svn diff' as necessary. Resolve any conflicts, then run 'svn resolved' on those files.
  9. Check everything in, and include the merge command used in the checkin comment so that it can easily be determined later where a change came from (there may be a more subversion-y way of finding out this info, but this makes life easy).