Checkin changes to a different branch

Tuesday, December 04, 2012 1 Comments

You have been working hard during all the afternoon, suddenly you realize that your workspace is not switched to the correct branch! The pending changes view is plenty of changes that should be committed in a different branch. How Plastic SCM can deal with this typical developer situation?.

Want to move your changes elsewhere?

You may know that we have two ways to avoid committing changes in the wrong branch.
The first one is the "Checkin changes to a different branch...", with this option you can commit your changes in a new branch, keeping the current one clean.

The second is the shelve operation, with this feature you can save the workspace changes in the Plastic SCM server and apply them later in any branch you want.

Check-in sub menu options

Already committed the changes?

If your changes are already committed in a wrong branch you can use the subtractive merge to "revert" the changes and keep the head branch as it was before committing the wrong changeset.

Now, the cherry pick merge is the key in order to place the changes to the right branch. Use the cherry pick to propagate the changeset content into the destination branch. Here you have an example of how the operation looks like:

Usage of the subtractive and cherry pick merge


The changeset #1 is the one we want to "move", the changeset #2 is the result of the subtractive merge (red merge link) and finally the changeset #3 is the the result of the cherrypick (purple merge link).

As you can see Plastic SCM has all the tools to save the day.

1 comment:

  1. Hey is there a command line command for checking in changes to a different branch?

    ReplyDelete