321
276

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

コミットメッセージのルールについて

Posted at

一般的なコミットメッセージのフォーマット

開発の現場では、可読性が高く、変更内容を素早く把握できるコミットメッセージ が求められます。
特に、Gitのログを見たときに、何が変更されたのかを簡潔に理解できることが重要です。
以下のような記述のルールがあるのでそれに即してコミットをする事を推奨します

templete
<タイプ>: <変更内容> (#<関連するIssue番号>)

具体例

example
git commit -m "feat: ユーザーのプロフィール編集機能を追加 (#12)"
git commit -m "fix: ログイン時のバグ修正 (#34)"
git commit -m "chore: ESLint の設定を更新"


よく使われるコミットタイプ

detail type
タイプ	説明	
feat:	新機能の追加	feat: ログイン画面にソーシャルログインを追加
fix:	バグ修正	fix: APIのリクエスト時にエラーが発生する問題を修正
refactor:	リファクタリング動作に影響なし	refactor: ユーザー認証ロジックを整理
chore:	設定ファイルの変更ライブラリ更新	chore: eslint のルールを調整
docs:	ドキュメント修正	docs: READMEにセットアップ手順を追加
style:	コードのフォーマット修正動作に影響なし	style: prettier を適用
test:	テストコードの追加修正	test: ユーザー登録APIのテストを追加
perf:	パフォーマンス改善	perf: 画像の遅延読み込みを実装
ci:	CI/CD関連の変更	ci: GitHub Actions のワークフローを修正

フロントエンドなどの記述例

Front-end type
編集する
git commit -m "feat: ダッシュボードのチャートを追加 (#15)"
git commit -m "fix: モーダルの表示が正しく機能しないバグを修正"
git commit -m "style: Tailwind CSSのクラスを整理"
バックエンドLaravel, Node.jsなど

バックエンドなどの記述例

Back-end type
git commit -m "feat: ユーザーのメール通知機能を追加"
git commit -m "fix: APIレスポンスのステータスコードを修正"
git commit -m "refactor: データベースのクエリ最適化"

インフラ・CI/CDなどのなどの記述例

CI/CD type
git commit -m "ci: Dockerコンテナの自動デプロイを設定"
git commit -m "chore: GitHub Actions のワークフロー修正"
321
276
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
321
276

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?