如何设置git提交消息的模式?不使用git钩子有什么替代方案
我找不到任何解决办法。请帮助
已经有一个内置的配置:
$ git config --global commit.template ~/.gitmessage.txt
,然后在~/.gitmessage
中像这样:
Subject line (try to keep under 50 characters)
Multi-line description of commit,
feel free to be detailed.
[Ticket: X]
裁判:
- git scm文档
- git scm的书
如果您只需要一次性使用模板,或者有多个不同的模板:
$ git commit --template <path to template file>
一种解决方案是使用包装器工具,如gitmoji-cli: https://github.com/carloscuesta/gitmoji