Jump to content

Merge selected files from one branch to another


ryexley

Recommended Posts

I'm having some trouble figuring out the right way to do this. I have some files that exist in a child branch that I'd like to merge back up to the parent branch...but *only* selected files...not *everything* that's changed from the child branch. Can someone please point me to some documentation somewhere that explains how this can be accomplished?

I've tried right-clicking on the child branch in Branch Explorer, selecting "Merge from this branch", selecting just the files I want to merge, and right-clicking on those files, and there is a "Merge selected files" context menu option, but its grayed out. Not sure why or what I'm doing wrong. Just need to be able to merge a few files back up to a parent branch. Little help?

Thanks.

Link to comment
Share on other sites

Hello ryexley,

Plastic SCM 4 relies in the DAG architecture, so, when you are merging from a branch you need to process all the suggested elements. If you are not interested in the full branch content you can use the cherry pick operation with the changesets you are interested in, but you also need to include the full changeset, a subset of it is not allowed.

The cherry pick option is inside the branch explorer changeset right click menu.

Link to comment
Share on other sites

  • 1 year later...

At the first place, you should checkin related changes together only. I mean – you should keep your changesets small and cohesive, then you can benefit from the changeset-as-one-compact-change philosophy.

 

However, there is a solution for you as you get into the situation when one changeset contains changes which you need to handle separately file by file. This is how you can do it:

  1. Make sure you are switched to the destination branch (on the last changeset).
  2. If you want to move all changes in those files – use Merge From the source branch. If you want to move only some changes in those files – use Cherry Pick(s) from the source branch.
  3. Uncheck all changes and check only those files you want to move.
  4. Shelve those files (see the small arrow next to the Checkin button).
  5. Check all changes, including those files.
  6. Undo all changes from the workspace (this discards the merge link too).
  7. Apply the shelve into the workspace.
  8. Checkin.
Link to comment
Share on other sites

  • 2 months later...

Changesets are atomic, you can't cherry pick individual files from them, because then the merge tracking would fall apart.  We went from a non-atomic system (Clearcase) to Plastic and it took a while for people to grasp the concept. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...