G

git-commit

by @githubv
4.6(720)

掌握编写清晰、规范的Git提交信息的能力,确保AI编码代理的每次代码提交都易于理解和追溯,是后端版本控制的关键。

Git Commit MessagesConventional CommitsVersion ControlGit CLICommit HistoryGitHub
安装方式
npx skills add github/awesome-copilot --skill git-commit
compare_arrows

Before / After 效果对比

1
使用前

AI智能体在生成Git提交信息时,常缺乏规范性和清晰度,导致提交历史难以追溯和理解。影响团队协作。

使用后

赋予AI智能体生成规范化Git提交信息的能力,确保提交历史清晰可读。显著提升代码管理效率和团队协作质量。

description SKILL.md

Git Commit with 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

TypePurpose
featNew feature
fixBug fix
docsDocumentation only
styleFormatting/style (no logic)
refactorCode refactor (no feature/fix)
perfPerformance improvement
testAdd/update tests
buildBuild system/dependencies
ciCI/config changes
choreMaintenance/misc
revertRevert commit

Breaking Changes

# Exclamation mark after type/scope
feat!: remove deprecated endpoint

# 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

# Also check status
git status --porcelain

2. Stage Files (if needed)

If nothing is staged or you want to group changes differently:

# Stage specific files
git add path/to/file1 path/to/file2

# Stage by pattern
git add *.test.*
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 of what changed (present tense, imperative mood, <72 chars)

4. Execute Commit

# Single line
git commit -m "<type>[scope]: <description>"

# Multi-line with body/footer
git commit -m "$(cat <<'EOF'
<type>[scope]: <description>

<optional body>

<optional footer>
EOF
)"

Best Practices

  • 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

Git Safety Protocol

  • 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)

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量27.5K
评分4.6 / 5.0
版本
更新日期2026年4月30日
对比案例1 组

用户评分

4.6(720)
5
36%
4
49%
3
14%
2
1%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

时间线

创建2026年3月14日
最后更新2026年4月30日
🎁 Agent 知识卡片