Wednesday, March 24, 2010

Subversion Merge

So you want to merge a subversion branch into the trunk. I tried to use TortoiseSVN but the subversion version on the server must be at least 1.5. Unfortunately I have 1.4 on the server and no access to update this. In order to merge via SVN command line, you can do the following:

1. Check out the trunk if you don't already have it. CD into the trunk.
2. Run:
svn merge https://subversion.branch.repository.url -r firstBranchRevision:lastBranchRevision .

When the branch is created, the firstRevision will be the last revision from the trunk (i.e., it's not going to be revision 1). The command figures out what changed in the branch and then merges those changes with your current working directory (.).

If there are any conflicts, you could resolve them with the command line tool, or, if you're like me, you can use TortoiseSVN to visually edit the conflicts.

No comments:

Post a Comment