git
config_error
ai_generated
true
警告:提交信息超过 72 个字符;某些工具可能会截断
warning: commit message exceeds 72 characters; might be truncated by some tools
ID: git/commit-message-too-long-warning
95%修复率
85%置信度
1证据数
2023-07-18首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| git 2.20 | active | — | — | — |
| git 2.35 | active | — | — | — |
| git 2.42 | active | — | — | — |
根因分析
Git 默认的提交信息长度限制(72 个字符)被超过,但这只是一个警告,不是错误。
English
Git's default commit message length limit (72 characters) is exceeded, but this is a warning, not an error.
官方文档
https://git-scm.com/docs/git-commit#_discussion解决方案
-
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...'
-
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).
无效尝试
常见但无效的做法:
-
40% 失败
The warning is a best practice; disabling it may cause issues with tools like email or changelog generators that expect short lines.
-
30% 失败
This only suppresses the warning but doesn't fix the underlying issue; long messages may still be truncated by external tools.