Merging a branch back into trunk as a replacement.

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
Jamie Clayton
Posts: 39
Joined: Tue Oct 02, 2007 3:21 am
Location: Brisbane, Australia
Contact:

Merging a branch back into trunk as a replacement.

Post by Jamie Clayton » Sun Sep 18, 2011 5:20 pm

G'day,

I took a branch of my main/trunk source code and started working on changesets in the branch. I now effectively want to update my main/trunk code with the branch changes. This should ensure that the code history in main/trunk includes everythink I did in the branch. There were no changes to the main/trunk code, so when I did the merge I thought it would effectively replace the code with the branch changes. However when I review folder differences between Main/Trunk and Branch I see that there are significant differences.

Reviewing this post comments from Linda, indicates that it might involve a combination of merge and copy and pasting of branch code to the working directory of the main/trunk code. Has any one got some instructions on how to do this? http://support.sourcegear.com/viewtopic ... ack#p63965
Jamie Clayton
Jenasys Design Pty Ltd (Australia)

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Merging a branch back into trunk as a replacement.

Post by Beth » Mon Sep 19, 2011 8:43 am

Just to make sure I understand this, you don't want your code to be a mixture of the trunk and the branch (basically, merging in changes), you just want the branched code to be the latest version in the trunk. Is that right?
Beth Kieler
SourceGear Technical Support

Jamie Clayton
Posts: 39
Joined: Tue Oct 02, 2007 3:21 am
Location: Brisbane, Australia
Contact:

Re: Merging a branch back into trunk as a replacement.

Post by Jamie Clayton » Mon Sep 19, 2011 9:36 pm

Beth, Yes that's correct.
The part that confused me is I thought that merging my branch changes into the main/trunk would do this but obviously not. Essentially I want to ensure I have a complete history of changes. I would even accept that all the changes I did in the branch got rolled up into a single changeset committed to source control.
Jamie Clayton
Jenasys Design Pty Ltd (Australia)

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Merging a branch back into trunk as a replacement.

Post by Beth » Tue Sep 20, 2011 9:17 am

What a merge branches does is take the change sets you've applied to the branch (the ones you select during the merge) and apply them to the trunk. I'm not sure I understand how you are ending up with not the result you want, unless you aren't applying all the change sets, or if you are merging a branch to an area that is not the area it came from.

Would you like to walk through this together? If so, send an email to support at sourcegear.com (attn: Beth) with a link to this forum thread.

If you prefer to just drop your latest files into the trunk, then check out the trunk, copy the files from your branch location on your local disk, then drop them onto the location on disk where your trunk is. Vault will see that as an edit. Then you can check in your trunk.

I think it would be better if we just walked through this to see what's going on in this case.
Beth Kieler
SourceGear Technical Support

Post Reply