Ivan Ivanov
Ivan Ivanov

Reputation: 2052

Mercurial: How to keep some files unchanged after merge?

I need to pull changes from one branch to another, but keep some files unchanged.

For example:

    > hg up -C production
    ...
    > hg merge feature-branch
    ...
    > hg st
    M file1
    M file2
    M file3
    R file4
    ...

Is there a way to keep file2 unchanged and file4 not deleted, and then commit?

Using hg transplant is inappropriate in my case because there're too many commits to find what exactly to transplant.

Upvotes: 0

Views: 150

Answers (1)

Idan K
Idan K

Reputation: 20881

$ hg revert -r . file2 file4

This reverts both files to how they were in the first parent of your working directory (.).

Upvotes: 1

Related Questions