git-commit
3
总安装量
2
周安装量
#61295
全站排名
安装命令
npx skills add https://github.com/xdanger/skills --skill git-commit
Agent 安装分布
mcpjam
2
antigravity
2
replit
2
junie
2
windsurf
2
zencoder
2
Skill 文档
Git Commit with Gitmoji + Conventional Commits
Commit Format
<Gitmoji> <type>(<scope>)[!]: <subject>
[optional body]
[optional footer(s)]
Example
⨠feat(auth): add OAuth2 login flow
- :sparkles: implement `GoogleAuthProvider` with PKCE
- :lock: add CSRF token validation
Closes #42
Commit Types
| Gitmoji | Type | Purpose |
|---|---|---|
| ⨠| feat |
New feature |
| ð | fix |
Bug fix |
| ð | docs |
Documentation only |
| ð | style |
Formatting/style (no logic) |
| â»ï¸ | refactor |
Code refactor (no feature/fix) |
| â¡ï¸ | perf |
Performance improvement |
| â | test |
Add/update tests |
| ðï¸ | build |
Build system/dependencies |
| ð· | ci |
CI/config changes |
| ð§ | chore |
Maintenance/misc |
| âªï¸ | revert |
Revert commit |
Additional Gitmoji (use with closest type)
| Gitmoji | Meaning | Type |
|---|---|---|
| ðï¸ | Security fix | fix |
| ð | Deploy | chore |
| ð¨ | Improve structure/format | refactor |
| ð¥ | Remove code/files | chore |
| ðï¸ | Critical hotfix | fix |
| â | Add dependency | build |
| â | Remove dependency | build |
| ð§ | Add/update config | chore |
| ðï¸ | Database changes | feat |
| ð¦ï¸ | Update compiled/packages | build |
| ð | Move/rename resources | chore |
| â¿ï¸ | Accessibility | feat |
| ð | Internationalization | feat |
| ð·ï¸ | Add/update types | feat |
Subject Line Rules
- Imperative mood, present tense: “add” not “added”
- Lowercase, no period at end
- Max 50 characters
- Wrap code references in backticks
- Focus on WHY, not WHAT
Breaking Changes
â»ï¸ refactor(api)!: change response envelope format
BREAKING CHANGE: `data` key renamed to `result` in all API responses
Body Format
Use Gitmoji shortcodes (:emoji:) as bullet prefixes in the body to describe individual changes:
- :sparkles: add new endpoint
- :bug: fix null pointer in handler
- :recycle: extract shared validation logic
Workflow
1. Analyze changes
# Check what's staged vs unstaged
git status --porcelain
# View staged diff (preferred)
git diff --staged
# View unstaged diff if nothing staged
git diff
2. Stage files if needed
# Stage specific files (preferred over git add -A)
git add path/to/file1 path/to/file2
# Stage by pattern
git add src/components/*
Never stage secrets (.env, credentials, private keys).
3. Determine commit attributes
From the diff, determine:
- Gitmoji + Type: What kind of change?
- Scope: What module/area? (optional but preferred)
- Breaking: Does it break existing API/behavior?
- Subject: One-line summary focusing on WHY
4. Commit
# Single line
git commit -m "⨠feat(auth): add OAuth2 login flow"
# Multi-line with body
git commit -m "$(cat <<'EOF'
⨠feat(auth): add OAuth2 login flow
- :sparkles: implement `GoogleAuthProvider` with PKCE
- :lock: add CSRF token validation
Closes #42
EOF
)"
Best Practices
- One logical change per commit
- Reference issues:
Closes #123,Refs #456 - Co-author: append
Co-Authored-By:footer when applicable
Git Safety
- NEVER update git config
- NEVER run destructive commands (–force, hard reset) without explicit request
- NEVER skip hooks (–no-verify) unless user asks
- NEVER force push to main/master
- If commit fails due to hooks, fix and create NEW commit (don’t amend)