Mercurial cherry picking changes for commit

后端 未结 10 1374
长情又很酷
长情又很酷 2020-12-01 01:15

Say, I made many changes to my code and only need to commit a few of those changes. Is there a way to do it in mercurial? I know that darcs has a feature like t

10条回答
  •  臣服心动
    2020-12-01 01:43

    You can use the record extension, which is distributed with Mercurial.

    You need to enable it in your ~/.hgrc file first, by adding it to the [extensions] section:

    [extensions]
    record=
    

    Then, just type hg record instead of hg commit, and you will be able to select which changes to which files you want to commit.

    You can also use the crecord extension which provides a nicer interface to review and select the changes. (It is not distributed with Mercurial, though, and I've seen it occasionally mess up a commit so it's not completely bug-free.)

提交回复
热议问题