每次我进行 merge 时,我都需要生成一个 merge 提交,我希望它不仅仅包含所有提交的摘要。
我的问题是如何格式化 git-fmt-merge-msg 或由什么决定此自动消息(我可以在提交后通过修改它并使用 git-log --pretty 手动执行此操作=格式:'...')
例如我想这样格式化它:
Merge branch 'test'
* test:
[BZ: #123] fifth commit subject
[BZ: #123] fourth commit subject
[BZ: #123] third commit subject
[BZ: #123] second commit subject
[BZ: #123] first commit subject
__________________________________________
Merge details:
[BZ: #123] fifth commit subject
at 2010-06-30 11:29:00 +0100
- fifth commit body
[BZ: #123] fourth commit subject
at 2010-06-30 11:22:17 +0100
- fourth commit body
[BZ: #123] third commit subject
at 2010-06-30 11:21:43 +0100
- third commit body
[BZ: #123] second commit subject
at 2010-06-30 11:21:30 +0100
- second commit body
[BZ: #123] first commit subject
at 2010-06-30 11:29:57 +0100
- first commit body
最佳答案
我知道这并没有回答最初的问题,但是为了像我这样访问此页面的 git 新手的利益,因为它是目前“git change merge commit message”的第一个 Google 结果,我会提到可以:
git commit --amend -m"New commit message"
更改 merge 提交的提交消息而不丢失与 merge 提交的任何父级的链接。
关于git - 如何自定义 git 的 merge 提交消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3148863/