简体   繁体   English

忽略毫无意义的“合并分支”在Git历史中提交?

[英]Ignore meaningless “Merge branch” commits in Git history?

Please take a look at the following Git history: 请查看以下Git历史记录:

在此输入图像描述

About every second commit is meaningless "Merge branch" noise. 大约每一次提交都是毫无意义的“合并分支”噪音。 I know that you can (and should) avoid it by rebasing, but my question is more about dealing with the situation afterwards. 我知道你可以(并且应该)通过变基来避免它,但我的问题更多的是关于事后处理的情况。

Is there a trick to ignore "Merge branch" commits without information? 是否有一个技巧忽略“合并分支”提交没有信息?

It would be acceptable for me to clone the repository and locally rewrite its history, so it is easier to analyze its changes (without all the "Merge branch" noise). 我可以接受克隆存储库并在本地重写其历史记录,因此更容易分析其更改(没有所有“合并分支”噪声)。

你在找

git log --no-merges

BroiSatse's nice "git log --no-merges" trick can also be applied in gitk: BroiSatse的漂亮“git log --no-merges”技巧也可以在gitk中应用:

  • View -> Edit view -> Additional arguments to git log: "--no-merges" 查看 - >编辑视图 - > git log的其他参数:“ - no-merges”

The result looks like this: 结果如下:

在此输入图像描述

to avoid having a lot of merges, it is better to pull using rebase: 为了避免大量合并,最好使用rebase:

git pull --rebase

see docs here 看到这里的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM