commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGit Commit (Conventional Commits)
Git Commit (Conventional Commits)
手順
Steps
1. git status
で変更内容を確認
git status1. Check the changes with git status
git status2. コミットすべきでないファイルの確認
2. Check for files that should not be committed
以下のようなファイルが含まれていないかチェック:
| 種類 | 例 |
|---|---|
| シークレット | |
| ビルド成果物 | |
| IDE設定 | |
| OS生成物 | |
| ログ・キャッシュ | |
該当ファイルがある場合:
- に追加
.gitignore - で除外されたことを確認
git status
Check for the following types of files:
| Type | Examples |
|---|---|
| Secrets | |
| Build artifacts | |
| IDE settings | |
| OS-generated files | |
| Logs & caches | |
If there are such files:
- Add them to
.gitignore - Verify they are excluded using
git status
3. git diff
で差分を確認(任意)
git diff3. Check differences with git diff
(optional)
git diff変更内容の詳細を把握するために実行。
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 .
でステージング
git add .5. Stage changes with git add .
git add .6. git commit
を実行(確認不要)
git commit6. Execute git commit
(no confirmation needed)
git commitコミットメッセージ形式
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 | 用途 |
|---|---|
| 新機能 |
| バグ修正 |
| ドキュメントのみの変更 |
| コードの意味に影響しない変更(空白、フォーマット等) |
| バグ修正でも機能追加でもないコード変更 |
| パフォーマンス改善 |
| テストの追加・修正 |
| ビルドプロセスやツールの変更 |
| CI設定の変更 |
| ビルドシステムや外部依存の変更 |
| type | Usage |
|---|---|
| New feature |
| Bug fix |
| Documentation-only changes |
| Changes that do not affect the meaning of the code (whitespace, formatting, etc.) |
| Code changes that are neither bug fixes nor feature additions |
| Performance improvement |
| Add or modify tests |
| Changes to build processes or tools |
| Changes to CI configurations |
| Changes to build system or external dependencies |
Scope(任意)
Scope (Optional)
変更の影響範囲を示す。例:
- - 認証機能
feat(auth): - - API関連
fix(api): - - README
docs(readme):
Indicates the scope of the change. Examples:
- - Authentication functionality
feat(auth): - - API-related
fix(api): - - README
docs(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 in the footer
BREAKING CHANGE: - If you updated , include that in the commit message
.gitignore