# 警告：提交信息超过 72 个字符；某些工具可能会截断

- **ID:** `git/commit-message-too-long-warning`
- **领域:** git
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

Git 默认的提交信息长度限制（72 个字符）被超过，但这只是一个警告，不是错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| git 2.20 | active | — | — |
| git 2.35 | active | — | — |
| git 2.42 | active | — | — |

## 解决方案

1. ```
   Shorten the commit message to under 72 characters, or use a multi-line commit message with a summary line under 50 characters: git commit -m 'Short summary' -m 'Longer body here...'
   ```
2. ```
   If you must keep the long message, configure git to allow longer lines: git config advice.commitMessageLength false (this suppresses the warning but doesn't guarantee tool compatibility).
   ```

## 无效尝试

- **** — The warning is a best practice; disabling it may cause issues with tools like email or changelog generators that expect short lines. (40% 失败率)
- **** — This only suppresses the warning but doesn't fix the underlying issue; long messages may still be truncated by external tools. (30% 失败率)
