| 解析 | git interpret-trailers --parse < 提交信息文件 |
|---|---|
| 追加 | --trailer 'Closes: #123',或在文件上 --in-place |
| 典型用途 | 钩子自动加 Signed-off-by / 引用单号 |
常用示例
常用示例
git log -1 --format='%B' | git interpret-trailers --parse
git interpret-trailers --in-place --trailer 'Refs: PROJ-231' .git/COMMIT_EDITMSG解析输出为「键: 值」列表;与多个工具约定的 trailer 词典保持一致,避免出现同义键。