小编shi*_*l88的帖子

如何自定义git的合并提交消息?

每次我进行合并时,我都需要生成合并提交,我希望它不仅仅包含所有提交的摘要.

我的问题是我如何格式化git-fmt-merge-msg或者什么决定了这个自动消息(我可以在提交后通过修改它并使用git-log --pretty = format:'...'来手动执行此操作)

例如,我想格式化它:

 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: …
Run Code Online (Sandbox Code Playgroud)

git git-merge

68
推荐指数
7
解决办法
7万
查看次数

标签 统计

git ×1

git-merge ×1