← 返回
开发者工具 中文

Git Changelog

Auto-generate beautiful changelogs from git history, grouped by conventional commit types
从 Git 历史自动生成按约定式提交类型分组的精美变更日志。
fratua
开发者工具 clawhub v1.0.0 1 版本 99873.7 Key: 无需
★ 0
Stars
📥 1,582
下载
💾 8
安装
1
版本
#latest

概述

git-changelog — Auto-Generate Changelogs

Generate polished, categorized changelogs from git commit history. Outputs markdown ready for CHANGELOG.md or GitHub releases.

Steps

1. Verify Git Repository

git rev-parse --is-inside-work-tree

If this fails, stop — not a git repository.

2. Determine Range

The user may specify:

  • Tag-to-tag: v1.0.0..v1.1.0
  • Since date: --since="2025-01-01"
  • Last N commits: -n 50
  • Since last tag: auto-detect with git describe --tags --abbrev=0

Default behavior — find the last tag and generate from there to HEAD:

LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null)

If no tags exist, use the full history.

3. Extract Commits

# Tag-to-HEAD
git log ${LAST_TAG}..HEAD --pretty=format:"%H|%s|%an|%ad" --date=short

# Date range
git log --since="2025-01-01" --until="2025-02-01" --pretty=format:"%H|%s|%an|%ad" --date=short

# Full history
git log --pretty=format:"%H|%s|%an|%ad" --date=short

4. Categorize by Conventional Commits

Parse each commit subject and group into categories:

PrefixCategoryEmoji
-------------------------
feat✨ FeaturesNew functionality
fix🐛 Bug FixesCorrections
docs📚 DocumentationDocs changes
style💄 StylingFormatting, no logic change
refactor♻️ RefactoringCode restructuring
perf⚡ PerformanceSpeed improvements
test✅ TestsAdding/fixing tests
build📦 BuildBuild system, deps
ci👷 CI/CDPipeline changes
chore🔧 ChoresMaintenance
(other)📝 OtherUncategorized

Parse pattern: type(scope): description or type: description

5. Generate Markdown

Output format:

# Changelog

## [v1.2.0] — 2025-02-15

### ✨ Features
- **auth**: Add OAuth2 support ([abc1234])
- **api**: New rate limiting middleware ([def5678])

### 🐛 Bug Fixes
- **db**: Fix connection pool leak ([ghi9012])

### 📚 Documentation
- Update API reference ([jkl3456])

Rules:

  • Include scope in bold if present: scope: message
  • Include short hash as reference: ([abc1234])
  • Sort categories: Features → Fixes → everything else
  • Omit empty categories
  • If commits include BREAKING CHANGE in body/footer, add a ### 💥 Breaking Changes section at the top

6. Detect Breaking Changes

git log ${LAST_TAG}..HEAD --pretty=format:"%H|%B" | grep -i "BREAKING CHANGE"

Also flag commits with ! after type: feat!: remove legacy API

7. Output

  • Default: print to chat for review
  • If user requests file output: write/append to CHANGELOG.md at project root
  • When prepending to existing CHANGELOG.md, insert after the # Changelog header, before previous entries

Edge Cases

  • No conventional commits: Fall back to listing all commits as "Other"
  • Merge commits: Skip merge commits (Merge branch..., Merge pull request...) unless user requests them
  • Monorepo: If user specifies a path, use git log -- path/to/package
  • No tags: Use full history or ask user for a date range
  • Empty range: Report "No commits found in the specified range"

Error Handling

ErrorResolution
------------------
Not a git repoTell user to navigate to a git repository
No commits foundConfirm the range/date filter; suggest broader range
Binary/garbled outputEnsure --pretty=format is used correctly
Permission deniedCheck file permissions on CHANGELOG.md

Built by Clawb (SOVEREIGN) — more skills at [coming soon]

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 04:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Dependency Audit

fratua
智能依赖健康检查——安全审计、过期检测、闲置依赖及优先更新方案
★ 0 📥 1,583
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,270
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 670 📥 324,268