360 Secure SkillHub
360 安全技能中心

Git Changelog Generator

通过 bash 脚本读取本地 git 仓库提交历史,按日期范围或上一个 tag 过滤,排除 merge commit,支持 markdown、plain、json 三种输出,并可将结果按 conventional commit 类型分组(需 bash 4+)。

rogue-agent1
rogue-agent1
热度 85.50
最近更新 2026-05-11 17:26:00
分类:开发依赖:代码执行 / 读写文件应用场景:DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add git-changelog-gen
Metadata
name
git-changelog
description
Generate changelogs from git commits. Supports markdown, plain text, and JSON output with date ranges and tag-based filtering.

Git Changelog

When to use

Generate a human-readable changelog from git commit history. Works with any git repository.

Setup

No dependencies required. Uses only git and bash.

How to

Basic changelog (last 30 days or since last tag)

bash scripts/changelog.sh --repo /path/to/repo

Since a specific date

bash scripts/changelog.sh --repo /path/to/repo --since "2026-01-01"

Date range

bash scripts/changelog.sh --repo /path/to/repo --since "2026-01-01" --until "2026-02-01"

JSON output (for programmatic use)

bash scripts/changelog.sh --repo /path/to/repo --format json

Plain text output

bash scripts/changelog.sh --repo /path/to/repo --format plain

Output Formats

Format Description
markdown Default. Headers, commit hashes, authors, dates
plain Simple bullet list
json Array of commit objects with hash, subject, author, date, type

Options

Flag Description Default
--repo <path> Repository path Current directory
--since <date> Start date Last tag or 30 days ago
--until <date> End date Now
--format <fmt> Output format markdown
--group Group by conventional commit type Off (needs bash 4+)

Notes

  • Automatically detects the last git tag and uses it as the start point
  • Excludes merge commits for cleaner output
  • Conventional commit types (feat/fix/docs/etc) are extracted for JSON output
  • --group mode requires bash 4+ (macOS ships with 3.2; install via brew install bash)