💡
gumi Vietnam
  • Home
    • COMPANY POLICY
      • Company Internal Regulation
      • Overtime Register Flow
    • DEVELOPMENT POLICY
      • General
        • Digital Asset Management
        • Server Management
        • Backlog Flow
      • Git Rule
        • Branch Management
        • Committing Code
        • Release Management
          • Create Pull Request (PR)
          • Semantic Versioning
        • Git Security
        • Git Security Checklist
        • Git Flow
        • Rules of Git commit message
        • Information in commit messages
      • Coding Convention
        • HTML/CSS Basic Note
        • Google HTML/CSS Rule
        • Sass Guideline
        • JavaScript Rule
        • Vue.js Rule
          • Style Guide
          • TypeScript with Composition API
          • Nuxt and Typescript Coding Convention
            • Nuxt Coding Convention
            • Typescript Coding Convention
        • PHP Rule
          • Basic Coding Standard
          • Coding Style Guide
        • Mobile Team
          • Architecture
            • MVVM in iOS Swift
            • iOS Clean Architecture
          • Convention
            • Android
              • Kotlin Style Guide
              • Coding Convention
            • iOS
              • Swift Style Guide
    • PRIVACY POLICY AND CLIENT CONFIDENTIALITY
      • Confidentiality Policy
      • Access Production Policy
        • Rule
        • Flow
        • Problem Resolve and Penalty
Powered by GitBook
On this page
  • 1. Định dạng (format) của Commit message
  • 2. Các <type> được chấp nhận
  • 3. <scope> (optional)
  • 4. Subject (Tiêu đề) của commit message
  • 5. Message body (optional)
  • 6. Footer (optional)
  • 7. Ví dụ

Was this helpful?

  1. Home
  2. DEVELOPMENT POLICY
  3. Git Rule

Committing Code

Tài liệu hướng dẫn việc thực hiện commit code theo đúng chuẩn của Google

1. Định dạng (format) của Commit message

Mỗi commit message sẽ bao gồm các thành phần header, body, và footer

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

Trong đó header là bắt buộc: type (bắt buộc), scope (tùy chọn), subject (bắt buộc)

2. Các <type> được chấp nhận

<type> của commit message được qui định như sau:

  • feat: Tính năng mới (a new feature)

  • fix: Sửa lỗi (a bug fix)

  • docs: Các thay đổi liên quan đến documentation

  • refactor: Thay đổi source code nhưng không liên quan đến fixbugs hay tính năng mới

  • perf: Thay đổi source code liên quan đến tối ưu, improves performance

  • test: Bổ sung các tests bị thiếu

  • build: Các thay đổi liên quan đến setting để build application hoặc document generation

  • ci: Thay đổi trong các setting về continuous integration/delivery setup

3. <scope> (optional)

<scope> được dùng để chỉ định cụ thể phần nào được thay đổi trong source code

Ví dụ:

feat(auth): introduce sign in via Facebook

4. Subject (Tiêu đề) của commit message

Tiêu đề chứa mô tả ngắn gọn về thay đổi của source code

  • Dùng thì hiện tại ở thể mệnh lệnh: “change” not “changed” nor “changes”

  • Không in hoa (capitalize) ký tự đầu

  • Không dùng dấu chấm (.) ở cuối câu

  • Giới hạn ký tự của tiêu đề là 72 ký tự

  • Nên chia thành các commit tương ứng vơi những thay đổi riêng biệt

5. Message body (optional)

Sử dụng body để lý do tại sao và những nội dung thay đổi trong commit của mình. Hầu hết dùng body để mô tả chi tiết những thay đổi.

6. Footer (optional)

Footer dùng để reference đến những Breaking Changes, ví dụ như close task thông qua commit này, vì vậy có thể reference đến backlog-id hay github issue id.

7. Ví dụ

# Example 1

Thường dùng, chỉ chứa header bao gồm type, scope và subject

docs(guide): update fixed docs from Google Docs

# Example 2:

Bao gồm header, body và footer, reference đến backlog-id

feat(directive): add directives disabled/checked/multiple/readonly/selected

New directives for proper binding these attributes in older browsers (IE).
Added coresponding description, live examples and e2e tests.

Closes #sdg-351

# Example 3:

docs(guide): update fixed docs from Google Docs

Couple of typos fixed:
- indentation
- batchLogbatchLog -> batchLog
- start periodic checking
- missing brace

PreviousBranch ManagementNextRelease Management

Last updated 2 years ago

Was this helpful?

Dùng tiếng anh, of course (Không dùng Tiếng Việt hoặc Tiếng Nhật)

😃