Mercurial: multiline commit message on the command line?

前端 未结 7 919
走了就别回头了
走了就别回头了 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:08

    In bash (since version 2.0):

    hg commit -m $'foo\nbar'
    

    (I.e. put a dollar sign before an opening single quote to make it parse escape sequences (like \n) within the string — note that it doesn't work with double quotes.)

提交回复
热议问题