开发者

Mercurial: How to keep some files unchanged after merge?

开发者 https://www.devze.com 2023-04-11 09:47 出处:网络
I need to pull changes from one branch to another, but keep some files unchanged. For example: > hg up -C production

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 fil开发者_开发知识库e3
    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.


$ hg revert -r . file2 file4

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

0

精彩评论

暂无评论...
验证码 换一张
取 消