git-commit-specification

Original🇨🇳 Chinese
Translated

Git Commit Specification, covering commit message format (feat/fix/refactor), Issue linking, branch naming, PR submission preparation, and rebase usage. Used when users submit code, write commit messages, create branches, or prepare PRs.

33installs
Added on

NPX Install

npx skill4agent add tencentblueking/bk-ci git-commit-specification

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

Git Commit Specification

Quick Reference

Format: Tag: Commit description #Issue number
Example: feat: Add pipeline template feature #1234
Branches: feature/xxx | bugfix/xxx | hotfix/xxx

Tag Types

TagDescriptionExample
feat
New feature
feat: Add pipeline template support #1234
fix
Bug fix
fix: Fix build log missing issue #5678
refactor
Code refactoring
refactor: Optimize query performance
perf
Performance optimization
perf: Reduce database queries
test
Testing
test: Add unit tests
docs
Documentation
docs: Update API documentation
chore
Build/tooling
chore: Update Gradle configuration
del
Destructive deletion
del: Remove deprecated API
(requires special approval)

When to Use

  • Submit code
  • Create a branch
  • Prepare a PR
  • Write commit messages

Commit Format

bash
# Standard format
feat: Add pipeline template feature #1234

# With scope
feat(process): Add pipeline template feature #1234

Branch Naming

bash
feature/pipeline-template-support   # Feature branch
bugfix/build-log-missing            # Bug fix branch
hotfix/critical-security-issue      # Hotfix branch

Preparations Before PR Submission

bash
# Use rebase to streamline commits
git rebase -i HEAD~5

# Sync upstream code
git fetch upstream
git rebase upstream/develop

Checklist

Confirm before submitting code:
  • commit message complies with format specifications
  • Linked Issue number
  • Used rebase to streamline commits
  • No sensitive information included
  • Code passed local tests