git 使用模板消息提交

git commit with template message

是否可以进行 git 提交,当编辑器打开时它已经充满了要编辑的消息?

示例:

git commit "some string"

将打开文本编辑器 "some string" 可以编辑。

用例:我有一个 git 别名来提交正在进行的工作(例如一天结束)git commit -m ":construction: WIP"(是的,我在一些提交消息上使用表情符号),但我会有时喜欢添加一些额外的细节。

对于 git documentation 有:

有什么解决办法吗?

使用 -e|--edit 选项允许手动编辑,即使您在命令行上提供消息也是如此:

$ git commit -em ":construction: WIP"

描述了这个选项和许多其他选项 in the documentation