Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging Trunk into Branch in XCode 4

Tags:

svn

xcode4

The new Xcode 4 has brought many useful (still buggy, but useful) additions, especially in the SCM department. One of them is the Branches capability. I have a project that has this structure: /trunk /branches/branch1 /branches/branch2

I want to merge current updates made into trunk on a branch, so that merging them back in the future won't be too painful. I know the required steps to do it on the command line but I find it too cumbersome and would rather do it via Xcode. I have the trial version of Cornerstone, and using the option "Synchronize branch" it quickly grabs all latest updates to trunk and apply them on my branch. On Xcode 4, the merge feature only lets me merge FROM branches, not from trunk! "Choose the branch to merge into the current branch". When in fact what I need is, from a branch, incorporate changes made on trunk. I can do it backwards, merging the branch on a fresh trunk working copy, but then the changes are radically big and it takes a long time.

Is there any option ? I thought of maybe telling my trunk is actually a branch, I don't even know if it would work but its not the optimal solution.

Thanks all.

like image 624
Rafael Nobre Avatar asked Apr 08 '11 18:04

Rafael Nobre


1 Answers

Use Xcode Organizer for the following steps:

  1. Commit any trunk changes
  2. Add temporary Branch with the trunk as starting point (e.g. "TempBranch")
  3. Select your working copy and Switch Branch to the branch you want to update with trunk changes

Use Xcode File menu to continue:

  1. File > Source Control > Merge... and select TempBranch
  2. Fix any conflicts.

Your branch should now contain the trunk changes. You can also delete the TempBranch.

like image 133
Victor Bogdan Avatar answered Sep 22 '22 23:09

Victor Bogdan