Svn Merge from Trunk to Branch
Every time I need to do this I try to use svn's --help which is only possible to decipher if you already know what to do. Then I spend too much time on the internet looking for the answer. And finally I break down and ask my tech lead. With much shame. I'm putting this up here so I least I'll know where to find it. Maybe you too.
In the directory of the branch:
If you checked in some files in revision 1002, then what you're saying is that you only want the changes from that checkin with '-r 1001:1002' Which is followed by the url of the trunk (where the changes were checked in) and a '.' to say that you want to merge to the current directory. Use '--dry-run' if you want to see what would happen without actually screwing anything up. After the merge is successful, you now have some modified files in the branch you can check in.
Done and done.
In the directory of the branch:
svn merge -r 1001:1002 https://svn.dev.your/repo/trunk/src .
If you checked in some files in revision 1002, then what you're saying is that you only want the changes from that checkin with '-r 1001:1002' Which is followed by the url of the trunk (where the changes were checked in) and a '.' to say that you want to merge to the current directory. Use '--dry-run' if you want to see what would happen without actually screwing anything up. After the merge is successful, you now have some modified files in the branch you can check in.
Done and done.
Comments
I'm not sure how I ever lived without a tool like this for managing branches.
Here's a nugget if you are merging from a revision number to the current version:
svn merge -r 1001:HEAD https://svn.dev.your/repo/trunk/src .
svn merge -r 1001:1002 ../path/to/trunk .
svn merge -r 1001:1005 ../path/to/trunk .
thanks,
Ravi
Cheers Jake!