Ocavue's Blog
[译] Udacity Git 提交信息风格指导 2018-09-25



翻译以授权,版权归 Udaacity 所有

# 介绍

这份风格指导应该在你的项目中作为官方指导使用。Udacity evaluators 会使用这份指导来对你的项目评分。对开发来说,什么样才是一个“完美”的风格很多人都有不同的见解。因此,为了减少到底应该使用何种风格的困惑,对在项目课程内的同学,我们强烈建议大家都参考这份指导。

# 提交信息

# 信息结构


type: subject




# 提交类型


  • feat:新功能
  • fix:修 bug
  • docs:文档修改
  • style:格式化;没有代码改动
  • refactor:重构生产代码
  • test:添加测试,重构测试;没有生产代码改动
  • chore:更新构建任务,包管理配置等;没有生产代码改动

# 主题



# 描述



# 脚注

脚注也是可选的,通常用来标示 issue ID, git 提交 hash 或者相关 url 等。

# 一个提交信息例子

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

本文所有版权归 Udacity 所有