name: git-commit description: 'Execute git commit with conventional commit message analysis and generation. Use when user asks to commit changes, create a git commit, or needs help writing commit messages. Supports auto-detecting type and scope from changes and generating conventional commit messages from diff.' metadata: source: github/awesome-copilot source_file: skills/git-commit/SKILL.md source_sha: c35f13b8760c18e5c087e08a762279c5ceab1fb6 adopted: 2026-01-29 customizations: Minor formatting adjustments for consistency
license: MIT
Git Commit Skill — Conventional Commits
Overview
Create standardized, semantic git commits using the Conventional Commits specification. Analyze the actual diff to determine appropriate type, scope, and message.
Conventional Commit Format
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Commit Types
| Type | Purpose | Example |
|---|---|---|
feat |
New feature | feat(auth): add OAuth2 login |
fix |
Bug fix | fix(api): handle null response |
docs |
Documentation only | docs: update README |
style |
Formatting (no logic) | style: fix indentation |
refactor |
Code refactor (no feature/fix) | refactor: extract helper |
perf |
Performance improvement | perf: cache API results |
test |
Add/update tests | test: add auth tests |
build |
Build system/dependencies | build: upgrade vite |
ci |
CI/config changes | ci: add GitHub Actions |
chore |
Maintenance/misc | chore: update .gitignore |
revert |
Revert commit | revert: undo auth change |
Breaking Changes
# Exclamation mark after type/scope
feat!: remove deprecated endpoint
# Or BREAKING CHANGE footer
feat: allow config to extend other configs
BREAKING CHANGE: `extends` key behavior changed
Workflow
1. Analyze Diff
# If files are staged, use staged diff
git diff --staged
# If nothing staged, use working tree diff
git diff
# Check status
git status --porcelain
2. Stage Files (if needed)
# Stage specific files
git add path/to/file1 path/to/file2
# Stage by pattern
git add *.test.ts
git add src/components/*
# Interactive staging
git add -p
⚠️ Never commit secrets (.env, credentials.json, private keys)
3. Generate Commit Message
Analyze the diff to determine:
- Type: What kind of change is this?
- Scope: What area/module is affected?
- Description: One-line summary (present tense, imperative mood, <72 chars)
4. Execute Commit
# Single line
git commit -m "feat(auth): add password reset flow"
# Multi-line with body
git commit -m "feat(auth): add password reset flow
Implements forgot password functionality with email verification.
Uses existing email service for token delivery.
Closes #123"
Best Practices
Do
- ✅ One logical change per commit
- ✅ Present tense: "add" not "added"
- ✅ Imperative mood: "fix bug" not "fixes bug"
- ✅ Reference issues:
Closes #123,Refs #456 - ✅ Keep description under 72 characters
- ✅ Capitalize first letter of description
Don't
- ❌ Mix unrelated changes in one commit
- ❌ Use past tense: "added feature"
- ❌ End description with period
- ❌ Write vague messages: "fix stuff"
- ❌ Commit secrets or credentials
Scope Examples
| Scope | Files Affected |
|---|---|
auth |
Authentication/authorization |
api |
API endpoints, routes |
ui |
UI components, styles |
db |
Database, migrations |
config |
Configuration files |
deps |
Dependencies |
test |
Test files only |
Common Patterns
Feature Commits
git commit -m "feat(user): add profile picture upload"
git commit -m "feat(search): implement full-text search"
git commit -m "feat!: redesign navigation structure"
Bug Fix Commits
git commit -m "fix(auth): prevent session timeout on refresh"
git commit -m "fix(form): validate email before submit"
git commit -m "fix: correct typo in error message"
Maintenance Commits
git commit -m "chore: update dependencies"
git commit -m "refactor(api): simplify error handling"
git commit -m "docs: add API documentation"
git commit -m "test: increase coverage for auth module"
Git Safety Protocol
- ⚠️ NEVER update git config without explicit request
- ⚠️ NEVER run destructive commands (
--force,reset --hard) without confirmation - ⚠️ NEVER skip hooks (
--no-verify) unless user asks - ⚠️ NEVER force push to
main/master - ⚠️ If commit fails due to hooks, fix the issue and create NEW commit (don't amend)
Issue References
# Close issue when merged
git commit -m "fix(auth): resolve login loop
Closes #123"
# Reference without closing
git commit -m "feat(api): add rate limiting
Refs #456"
# Multiple issues
git commit -m "feat(auth): implement SSO
Closes #123
Closes #124
Refs #100"
Commit Message Checklist
- Type correctly identifies change category
- Scope (if used) correctly identifies affected area
- Description is present tense, imperative mood
- Description is under 72 characters
- Body explains "what" and "why" (if needed)
- Issue references included (if applicable)
- Breaking changes marked with
!or footer - No secrets or credentials in diff
References
- Conventional Commits
- Angular Commit Guidelines
- github/awesome-copilot git-commit skill