관리 메뉴

캐나다 전산실 근무자

Writing Meaningful Git Commit Messages 본문

개발관련-이것저것

Writing Meaningful Git Commit Messages

모데라투스 2019. 2. 20. 05:32

Commit Message Format

Each commit message consists of a header, a body and an optional footer. The header has a special format that includes a type, a scope, and a subject:

    <type>(<scope>): <subject>     <BLANK LINE>     <body>><BLANK LINE>     <footer> 

Types of commit messages:

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

Scope

The candidates for scope depends on the project and the technologies being used. It is fairly up to the developer to select a scope. (Angular uses its specific set of scopes.)

Subject

The subject contains a succinct description of the change:

  • use the imperative, present tense: “change” not “changed” nor “changes”
  • don’t capitalize the first letter
  • no dot/period (.) at the end

Footer is used for citing issues that this commit closes (if any).

Examples

docs(server): add javadoc comments on methods 

This message implies that the changes made in this commit are only concerned with documentation changes (or the like) in server side code.

feat(core): add new command 'Upload' to UI 

Adding a new feature — to the core functionality of the application.

fix: update GET headers (#142) 

Fix errors pertaining to HTTP GET headers which close the issue 142.

Comments