Easiest way to split a change set in mercurial

There are two ways to split a changeset, depending on whether or not you’ve already committed the changes that you wish to split:

To selectively commit changes from your working directory (if you haven’t committed your changes yet):

  • Use hg record. (This is similar to using git commit --patch.)

To split an existing changeset (if you’ve already committed your changes):

  1. Use hg histedit and select the edit option on the changeset you want to edit.
    (This is similar to using git rebase -i.)

  2. Use hg record to selectively commit your changes as separate changesets.

  3. Use hg histedit --continue when you’re done. The remaining uncommitted changes will be included in a final changeset.

As others have mentioned, you can use hg crecord in the place of hg record.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)