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. 效果

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

相关推荐
念一不念二2 小时前
[Git]git仓库管理的使用
git
HZ·湘怡3 小时前
Gitee 手把手
git·gitee
A懿轩A3 小时前
【2026 最新】下载安装 Git 详细教程 (Windows)
git
@_@ prince @_@3 小时前
Git 命令大全(带详细说明)
git·gitee·github·visual studio
念一不念二3 小时前
【Git】命令行使用操作
git
zhangfeng11334 小时前
平替 Claude Code 类似的开源项目 — GitHub Star 前十排名
开源·github·claude code
念一不念二4 小时前
【vscode】Git的中好用的命令和技巧
git
DogDaoDao4 小时前
【GitHub】Warp 终端深度解析:Rust + GPU 加速的 AI 原生终端开源架构
人工智能·程序员·rust·开源·github·ai编程·warp
kyriewen15 小时前
奥特曼借GPT-5.5干杯,而你的Copilot正按Token收钱
前端·github·openai