Mercurial: multiline commit message on the command line?

前端 未结 7 917
走了就别回头了
走了就别回头了 2021-02-06 20:20

How can I specify a multiline commit message for mercurial on the command line?

hg commit -m \"* add foo\\n* fix bar\"

does not work. The log

7条回答
  •  北荒
    北荒 (楼主)
    2021-02-06 21:20

    From Windows cmd, do this command for a multiline commit.

    hg commit -l con
    

    This allows you to enter a multiple line commit message straight from the command line. To end your message, hit Enter, and on a line by itself hit Ctrl + Z and Enter again.

    Why? The -l option to hg commit says to read the commit message from a file, and con specifies that the file is actually the console.

提交回复
热议问题