Search code examples
mercurialbranchworking-copy

Mercurial, commit changes in working copy to another branch


I forgot to switch my working copy back to the correct branch and made some changes.

How can I commit the current changes (but not all other changes in the current branch) to my original branch?


Solution

    • Shelve extension allow you to store WIP, get clean working dir, update to needed branch, release shelve
    • MQ exension (somehow overkill) allow to do the same thing, as shelve
    • At last, you can commit into wrong branch and rebase this changeset to the correct parent, using Rebase extension