Mercurial (hg) commit only certain files

前端 未结 3 735
失恋的感觉
失恋的感觉 2020-12-07 16:20

I\'m trying to commit only certain files with Mercurial. Because of of hg having auto-add whenever I try to commit a change it wants to commit all files. But I don\'t want t

3条回答
  •  温柔的废话
    2020-12-07 16:51

    As of 3.8 you can also use hg commit --interactive to select the files (before 3.8 you can use crecord extension for similar functionality). The --interactive (or just -i) flag will cause hg to prompt you for the files you want to include in the commit. As an added bonus you can even include/exclude chunks within the files.

    Here is an example of what the interface looks like. Note this is an old screenshot (of crecord actually) so interface has changed slightly (but basics are the same). crecord screenshot

    Note to get that interface you need the curses interface enabled. You can do that for single run with hg commit --config ui.interface=curses --interactive or generally by adding the the following to your .hgrc:

    [ui]
    interface = curses
    

提交回复
热议问题