相关疑难解决方法(0)

如何使用git merge --squash?

我有一个远程Git服务器,这是我想要执行的场景:

  • 对于每个bug /功能,我创建了一个不同的Git分支

  • 我继续使用非官方的Git消息在Git分支中提交我的代码

  • 在顶级存储库中,我们必须使用官方Git消息对一个错误进行一次提交

那么如何将我的分支合并到远程分支,以便他们只为我的所有签到提交一个提交(我甚至想为此提供提交消息)?

git git-merge git-squash

1101
推荐指数
8
解决办法
52万
查看次数

如何自定义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 ×2

git-merge ×2

git-squash ×1