◯ 免费:每天5次 • 重置倒计时 16h 13m
开发 & 技术

Git 提交信息生成器

根据常规提交规范或您团队的格式撰写清晰的提交信息。包括范围、类型和重大变更指示。

了解更多

Git Commit Message Generator 将冗长的变更描述转化为简洁、结构清晰、遵循团队规范的提交信息。支持 Conventional Commits、Angular 和 Semantic 风格,配有恰当的类型前缀、作用域和正文格式。生成的提交信息让 git log 易读、更新日志可自动化、代码历史可检索。

0 / 3000

✓ 免费使用——无需注册,无需信用卡。

开发者

面向新功能的约定式提交(Conventional Commit)

开发者可将对工作的简单描述转化为一条整洁、带正文的 Conventional Commits 提交信息。

查看输入和输出预览

输入

有何变更?
Added input validation to the user registration form. Now checks email format, password strength (min 8 chars, 1 uppercase, 1 number), and duplicate username. Shows inline error messages under each field.
提交规范
Conventional Commits
变更类型
feat(新功能)
范围(可选)
auth

输出(节选)

feat(auth): add registration form input validation

Validate email format, enforce password strength (min 8 chars, 1 uppercase, 1 number), and reject duplicate usernames. Display inline error messages beneath each field for clearer user feedback.

- Add client-side validators for email, password, and username
- Surface field-level error states in the registration form
- Prevent submission until all fields pass validation
开发者

面向 Bug 修复的约定式提交(Conventional Commit)

工程师可生成精确、关联 issue 的修复提交,说明根本原因而非仅仅是表象。

查看输入和输出预览

输入

有何变更?
Fixed a bug where the shopping cart total didn't update when a coupon was removed. The discount stayed applied because the recalculation only ran on coupon add, not remove. Now recalculates on both add and remove.
提交规范
Conventional Commits
变更类型
fix(缺陷修复)
范围(可选)
cart

输出(节选)

fix(cart): recalculate total when a coupon is removed

The cart total previously retained a discount after a coupon was removed because recalculation only triggered on coupon add. Trigger the recalculation on both add and remove so the displayed total always reflects active coupons.

Fixes #482
自由职业者

面向文档更新的 Angular 风格提交

贡献者和自由职业开发者可让文档提交保持整洁,并与团队约定保持一致。

查看输入和输出预览

输入

有何变更?
Updated the README and API documentation to cover the new webhook endpoints, added a quickstart example, and fixed several broken links in the authentication section.
提交规范
Angular 规范
变更类型
docs(文档)
范围(可选)
readme

输出(节选)

docs(readme): document webhook endpoints and fix auth links

Add coverage for the new webhook endpoints, including a quickstart example, and repair broken links throughout the authentication section.

- Document POST /webhooks subscribe/unsubscribe endpoints
- Add a copy-paste quickstart snippet
- Fix three dead links in the Authentication guide

你的 Git 提交信息生成器 结果将显示在这里

你将得到带注释的整洁代码块,以及对改动内容的简短说明。

如何使用 Git 提交信息生成器

  1. 用通俗的语言描述你所做的更改——改动了哪些文件、行为有何不同,以及你为何做出这次更改。
  2. 选择您团队的提交约定(Conventional Commits 是最广泛采用的)。
  3. 选择最能归类您更改的类型——'feat' 表示新功能,'fix' 表示错误修复,'refactor' 表示重构。
  4. 可选地添加范围以缩小上下文(例如,'auth' 用于身份验证更改,'ui' 用于前端更新)。

使用案例

1

在团队开发者之间编写一致的提交信息

2

生成可与自动变更日志生成器配合使用的提交信息

3

为开源贡献和拉取请求创建描述性提交信息

4

使用清晰的前后对比记录复杂的重构更改

最佳结果的技巧

  • 在描述中加入“为什么”,而不仅是“是什么”——这有助于生成为未来开发者提供有价值上下文的提交信息。
  • 对于 monorepo,使用具体的作用域:“api”、“web”、“shared”、“infra”——这能让 git log 的筛选更加实用。
  • 对于破坏性变更,请说明旧行为是什么以及现在的行为——生成器将格式化适当的 BREAKING CHANGE 页脚。
  • Conventional Commits 格式可配合 semantic-release、standard-version 等工具实现自动版本升级和变更日志生成。

常见问题

Conventional Commits 是什么?

Conventional Commits 是一种提交信息规范,提供结构化格式:type(scope): description。它支持自动生成变更日志、语义化版本升级,并使 git 历史可搜索。它是业界最广泛采用的提交约定。

我应该使用仅主题版本还是详细版本?

对小的、易于理解的更改(如拼写错误修复、依赖更新)使用仅主题模式。对功能添加、错误修复、重构或任何需要让后续开发者了解原因的更改,使用带正文的详细版本。

我应该使用什么范围?

作用域表示受影响的代码库部分:'auth' 用于身份验证,'api' 用于 REST 接口,'ui' 用于前端组件,'db' 用于数据库更改,'ci' 用于流水线更改。请在团队中统一使用作用域——跨领域更改可留空。

这如何帮助编写变更日志?

Conventional Commits 格式可机器读取。像 semantic-release、standard-version 和 release-please 这样的工具可以解析你的提交,自动生成分类的变更日志(功能、错误修复、重大变更),并确定版本号。

什么是72字符规则?

Git 和许多工具将提交信息的第一行显示为摘要。将主题行保持在 72 个字符以内可确保在 git log、GitHub 和 IDE 界面中完整显示而不被截断。正文也应在 72 个字符处换行,以便在终端中易于阅读。

属于这些工作流

本工具用于帮助你更高效完成任务的分步指南中

🔒
您的隐私受到保护

我们会将您的输入和结果保存最多 90 天,用于运行服务、防止滥用,以及在您登录时显示您的历史记录。这些内容由我们隐私政策中列出的 AI 服务商处理。我们不会出售这些内容。

⚖️ 对比此工具

并排查看此工具的表现:

Git 提交信息生成器 vs. 变更日志生成器 查看对比 →

相关工具

试用此智能体

YouTube转博客代理YouTube链接 → 转录文本 → 1500字博客文章 → 5条社交片段 → 邮件简报草稿 → 优化视频描述。一个链接,全套内容。试用此智能体 →

相关工作流

规划与规范功能从用户故事到技术规格运行工作流 →

阅读更多