text Git Commit Messages结构

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text Git Commit Messages结构相关的知识,希望对你有一定的参考价值。

Message Structure
A commit messages consists of three distinct parts separated by a blank line: the title, an optional body 
and an optional footer. The layout looks like this:

type: subject

body

footer

----------------------------------------------------------------------------------------------------------

The Type
The type is contained within the title and can be one of these types:

feat: a new feature
fix: a bug fix
docs: changes to documentation
style: formatting, missing semi colons, etc; no code change
refactor: refactoring production code
test: adding tests, refactoring test; no production code change
chore: updating build tasks, package manager configs, etc; no production code change

----------------------------------------------------------------------------------------------------------

The Subject
Subjects should be no greater than 50 characters, should begin with a capital letter and do not end with a period.

Use an imperative tone to describe what a commit does, rather than what it did. For example, use change; not changed or changes.

-------------------------------------------------------------------------------------------------------------
The Body
Not all commits are complex enough to warrant a body, therefore it is optional and only used when a commit requires a bit of explanation and context. Use the body to explain the what and why of a commit, not the how.

-----------------------------------------------------------------------------------------------------------

The Footer
The footer is optional and is used to reference issue tracker IDs.

------------------------------------------------------------------------------------------------------------

以上是关于text Git Commit Messages结构的主要内容,如果未能解决你的问题,请参考以下文章

text 批量更改git commit author

text 列出git commit中的所有文件

text git reset staging to commit origin

text 在git commit消息前面的JIRA ID。

text 本地git存储库的post-commit

text 用于远程部署的post-commit git示例