GitHub Copilot 一键生成中文commit提示语规则设置

文章目录

  • [1. 设置规则](#1. 设置规则)
  • [2. 效果](#2. 效果)

1. 设置规则

以idea为例:setting->Tools->GitHub Copilot->Customizations

复制以下规则到git-commit-instructions.md

md 复制代码
please generate a commit message with Chinese.
Make sure it includes an accurate and informative subject line that succinctly summarizes the key points of the changes, the response must only have commit message content and must have blank line in message template.

Below is the commit message template:

<type>(<scope>): <subject>
// blank line
<body>
// blank line
<footer>

The Header is mandatory, while the Body and Footer are optional.

Regardless of which part, no line should exceed 72 characters (or 100 characters). This is to avoid automatic line breaks affecting aesthetics.

Below is the type Enum:

- feat: new feature
- fix: bug fix
- docs: documentation
- style: formatting (changes that do not affect code execution)
- refactor: refactoring (code changes that are neither new features nor bug fixes)
- test: adding tests
- chore: changes to the build process or auxiliary tools

The body section is a detailed description of this commit and can be split into multiple lines. Here's an example:

More detailed explanatory text, if necessary. Wrap it to about 72 characters or so.

Further paragraphs come after blank lines.

- Bullet points are okay, too
- Use a hanging indent

2. 效果

以上为个人学习分享,如有问题,欢迎指出:)

相关推荐
zhensherlock1 天前
Protocol Launcher 系列:Mail Assistant 轻松发送 HTML 邮件
前端·javascript·typescript·node.js·html·github·js
阿里嘎多学长1 天前
2026-04-11 GitHub 热点项目精选
开发语言·程序员·github·代码托管
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2026-04-11)
人工智能·ai·大模型·github·ai教程
马优晨1 天前
git restore --source 提交id 和 git reset --hard 提交id 有什么区别
git·git reset·git restore·git回退的区别·git回退代码
小臭希1 天前
Git(代码版本控制系统)
java·git·github
Unity粉末状在校生1 天前
Git解决fatal: Could not read from remote repository.的问题
git
少年攻城狮1 天前
Obsidian系列---【如何使用obsidian同步到git?】
git
Hommy881 天前
【开源剪映小助手】Docker 部署
docker·容器·开源·github·aigc
do better myself1 天前
网站源码如何部署和加入GIT仓库的
git
爱学英语的程序员2 天前
Git 提交 LF will be replaced by CRLF the next time Git touches it 报错
git