Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two svn branches checked out, "b1" and "b2". I would like to merge all of my commits from the "b1" branch onto the "b2" branch. I have tried something like

svn merge -r HEAD:HEAD b1 b2

but it does nothing. I am sure I have this command wrong but I can't find good documentation on it. I would like to do this on the client side and not create a third branch.

Any ideas?

Thanks!

share|improve this question
    
This is best a question for Stack Overflow - those guys are the source control guru's –  Mark Henderson Sep 3 '09 at 4:23

2 Answers 2

up vote 7 down vote accepted

Your problem is with the -r flag. You have to specify a range of revisions. So for example:

svn merge -r 13:HEAD b1 b2

To figure out the correct revision number you can do:

svn log --stop-on-copy b1

log will then only list commits which happened on b1. The smallest revision number you'll see will be your pick.

I've never used this form though. I always ensured that I was actively on branch b2, and then did:

svn merge -r 13:HEAD url://to/branch/b1
share|improve this answer
2  
Be sure to back up everything before attempting! –  David Rickman Sep 3 '09 at 8:23
    
Yes.... or us git :P –  exhuma Sep 3 '09 at 14:44

The "svnmerge" or "svnmerge.py" command can help with this. Note, this is a different command than "svn merge". More information is available at the svnmerge.py Wiki page including details on how to use it, a quickstart guide, etc.

I have used it to manage merging between several checkouts of one particular repository, where I make changes in one, then merge the changes from that branch into the other branch, which may have changes of it's own which are not merged back. For this usage, svnmerge.py has worked fantastically.

Sean

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.