Inkerk Blockchain Git Commit 风格指南


这篇风格指南作为 inKerk Blockchain 项目的官方指南,应用在 inKerk 所有项目中。

Commit Messages


一条 Commit message 应该包含使用空行隔开的如下三个部分:标题栏、可选的内容和可选的底部,总体看起来应该像这样:

类型: 主题







Commit 主题应该不超过 50 个字符,且应开始于大写字母。结尾无限标注句号。

使用祈使句的形式来描述一个 Commit 的动作。 比如, 使用 change; 而不是 changed 或 changes.


由于 Commit 的复杂程度不同,因此不要求每个 Commit 都写内容。主体内需要说明 What (是什么)Why (为什么),以确保阅读你的 Commit 的人能够明了前因后果。

编写正文时,需要注意标题和正文之间的空行,并限制每一行的长度不超过 72 个字符。


底部信息用于记录 ISSUE 跟踪器或其他相关软件的连接。


feat: Summarize changes in around 50 characters or less

More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.

Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequenses of this
change? Here's the place to explain them.

Further paragraphs come after blank lines.

 - Bullet points are okay, too

 - Typically a hyphen or asterisk is used for the bullet, preceded
   by a single space, with blank lines in between, but conventions
   vary here

If you use an issue tracker, put references to them at the bottom,
like this:

Resolves: #123
See also: #456, #789