commit
Generate a commit message based on current changes and commit all staged and unstaged changes to git
来源信息
- 仓库
- ok-oldking/ok-script
- 最近来源活动
- 2026年4月8日 09:18
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 762
- 分支
- 215
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- commit
- description
- Generate a commit message based on current changes and commit all staged and unstaged changes to git
# Commit Changes
When instructed to commit changes, follow these steps:
## 1. Check for uncommitted changes
// turbo
```powershell
git status --short
```
If there are no uncommitted changes (no output from the command above), tell the user "No uncommitted changes to commit." and **STOP**.
## 2. Review changes and generate a commit message
// turbo
```powershell
git diff --stat
```
// turbo
```powershell
git diff
```
Review the output of `git diff` and `git diff --stat`. Write a concise, descriptive commit message summarizing **only these uncommitted changes**. The message should:
- Use imperative mood (e.g. "Add …", "Fix …", "Refactor …")
- Be a single line for simple changes.
- For complex changes, use a single summary line, followed by a blank line and bullet points.
## 3. Stage and commit all changes
// turbo
```powershell
git add -A
```
// turbo
```powershell
git commit -m "<generated commit message>"
```
Replace `<generated commit message>` with the message you wrote in step 2.
## 4. Report
Tell the user:
- The commit message used.
- A brief summary of what was committed.
在 GitHub 查看