commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Commit (Conventional Commits)

Git Commit (Conventional Commits)

手順

Steps

1.
git status
で変更内容を確認

1. Check the changes with
git status

2. コミットすべきでないファイルの確認

2. Check for files that should not be committed

以下のようなファイルが含まれていないかチェック:
種類
シークレット
.env
,
*.pem
,
credentials.json
,
secrets.yaml
ビルド成果物
node_modules/
,
dist/
,
build/
,
__pycache__/
IDE設定
.idea/
,
.vscode/
(プロジェクト共有しない場合)
OS生成物
.DS_Store
,
Thumbs.db
ログ・キャッシュ
*.log
,
.cache/
,
coverage/
該当ファイルがある場合:
  1. .gitignore
    に追加
  2. git status
    で除外されたことを確認
Check for the following types of files:
TypeExamples
Secrets
.env
,
*.pem
,
credentials.json
,
secrets.yaml
Build artifacts
node_modules/
,
dist/
,
build/
,
__pycache__/
IDE settings
.idea/
,
.vscode/
(if not shared in the project)
OS-generated files
.DS_Store
,
Thumbs.db
Logs & caches
*.log
,
.cache/
,
coverage/
If there are such files:
  1. Add them to
    .gitignore
  2. Verify they are excluded using
    git status

3.
git diff
で差分を確認(任意)

3. Check differences with
git diff
(optional)

変更内容の詳細を把握するために実行。
Run this to understand the details of the changes.

4. コミットメッセージを作成

4. Create a commit message

変更内容を分析し、Conventional Commits形式でメッセージを作成。
Analyze the changes and create a message in Conventional Commits format.

5.
git add .
でステージング

5. Stage changes with
git add .

6.
git commit
を実行(確認不要)

6. Execute
git commit
(no confirmation needed)



コミットメッセージ形式

Commit Message Format

Conventional Commitsに従う:
<type>[optional scope]: <description>

[optional body]

[optional footer]
Follow Conventional Commits:
<type>[optional scope]: <description>

[optional body]

[optional footer]

Type一覧

Type List

type用途
feat
新機能
fix
バグ修正
docs
ドキュメントのみの変更
style
コードの意味に影響しない変更(空白、フォーマット等)
refactor
バグ修正でも機能追加でもないコード変更
perf
パフォーマンス改善
test
テストの追加・修正
chore
ビルドプロセスやツールの変更
ci
CI設定の変更
build
ビルドシステムや外部依存の変更
typeUsage
feat
New feature
fix
Bug fix
docs
Documentation-only changes
style
Changes that do not affect the meaning of the code (whitespace, formatting, etc.)
refactor
Code changes that are neither bug fixes nor feature additions
perf
Performance improvement
test
Add or modify tests
chore
Changes to build processes or tools
ci
Changes to CI configurations
build
Changes to build system or external dependencies

Scope(任意)

Scope (Optional)

変更の影響範囲を示す。例:
  • feat(auth):
    - 認証機能
  • fix(api):
    - API関連
  • docs(readme):
    - README
Indicates the scope of the change. Examples:
  • feat(auth):
    - Authentication functionality
  • fix(api):
    - API-related
  • docs(readme):
    - README

Description

Description

  • 命令形で書く(「追加した」ではなく「追加」)
  • 50文字以内を目安
  • 末尾にピリオドをつけない
  • Write in imperative mood (use "add" instead of "added")
  • Aim for within 50 characters
  • Do not add a period at the end

Body(任意)

Body (Optional)

  • 3行目以降に記載
  • 変更の理由や背景
  • 特筆すべき実装詳細

  • Write from the 3rd line onwards
  • The reason or background for the change
  • Notable implementation details

Examples

feat(models): 新しいモデルUserを追加

ユーザー認証機能の基盤として、Userモデルを実装。
パスワードはbcryptでハッシュ化して保存する。
fix(api): レート制限のバグを修正

1分あたりのリクエスト数が正しくカウントされていなかった問題を修正。
Redis TTLの設定ミスが原因。
refactor: 認証ミドルウェアを分離

feat(models): Add new User model

Implemented the User model as the foundation for user authentication functionality. Passwords are hashed and stored using bcrypt.
fix(api): Fix rate limiting bug

Fixed the issue where request counts per minute were not being calculated correctly. The cause was an incorrect Redis TTL setting.
refactor: Separate authentication middleware

注意事項

Notes

  • 破壊的変更がある場合は
    BREAKING CHANGE:
    をフッターに記載
  • .gitignore
    を更新した場合は、そのことをコミットメッセージに含める
  • If there are breaking changes, include
    BREAKING CHANGE:
    in the footer
  • If you updated
    .gitignore
    , include that in the commit message