Use of an exclamation mark in a Git commit message via the command line

后端 未结 6 793
面向向阳花
面向向阳花 2020-12-07 12:52

How do I enter an exclamation point into a Git commit message from the command line?

It is possible to escape the exclamation point with a backslash, but then the ba

6条回答
  •  春和景丽
    2020-12-07 13:20

    Another way to solve that is to add a space after ! like:

    git commit -am "Nailed it! "
    

    Note the space between ! and the last ".

    (The space won't be included in the commit message - Git trims trailing whitespace from commit messages automatically.)

提交回复
热议问题