显示提交A开启但提交B不开启的所有分支吗? [英] Show all branches that commit A is on and commit B is not on?

查看:68
本文介绍了显示提交A开启但提交B不开启的所有分支吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个分支,并且发现了一个提交A,该提交A将错误引入了系统。随后,该问题由提交B固定在分支之一上,并合并回主节点,但当时尚未被所有挑衅的分支挑选。

I have multiple branches and have discovered a commit A that introduced a bug into the system. This was subsequently fixed by commit B on one of the branches and merged back to master, but at the time it was not cherry-picked to all offending branches.

我想知道是否有一条命令显示所有有提交A但没有提交B的冒犯分支吗?

I was wondering if there is a command that will show all offending branches that have commit A but do not have commit B?

我一直在使用以下命令来确定提交是否存在在分支上

I have been using the following to determine that a commit exists on a branch

$ git branch -r --contains=A

,但我想尝试在其中添加类似

but I want to try and add to this to include something like

$ git branch -r --contains=A ^--contains=B

旁注,我已经检查过,没有其他提交包含相同的更改,即尚未将其提交给其他任何分支,但是有些分支的提交是B,自合并以来它们与主分支有所不同,有些分支没有t在引入提交B之前它们已经存在的位置。

As a side note I have checked and there are no other commits that contain the same change, i.e. it has not been cherry-picked on to any other branches, but some branches have commit B where they have diverged from master since the merge and some don't where they already existed before commit B was introduced.

另外,abili如果已经解决问题的提交(在这种情况下为提交B)被挑选到已经提供了不同提交SHA的几个分支上,那么检查多个提交将很有用。

Additionally the ability to check for several commits would be useful where the commit that has fixed an issue (commit B in this case) is cherry-picked onto several branches already giving different commit SHA's.

推荐答案

您是否尝试过以下方法:

Have you tried this:

diff <(git branch -r --contains=A) <(git branch -r --contains=B)

完美,但可能会有所帮助。

It is far from perfect but it might help.

这篇关于显示提交A开启但提交B不开启的所有分支吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆