简体   繁体   中英

Merging Trunk into Branch in XCode 4

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.

Use Xcode Organizer for the following steps:

  1. Commit any trunk changes
  2. Add temporary Branch with the trunk as starting point (eg "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.

Xcode 4 does not support merging from the trunk to a branch. This was confirmed by an Apple employee in the following thread in Apple's developer forums:

Keeping a Subversion branch in sync

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM