问题描述
我有一个随机特性/ XXXXXXX分支,它有一些提交,并自然是开发分支,这些分支最终将合并。
如何检查某些旧的提交(例如,从分支功能/用户注册提交ab123456)已被以某种方式带入/合并到我当前活动的分支(例如开发)?通过直接合并功能分支来开发或通过上/合并通过其他中间分支。通过git命令或通过SourceTree UI,两种方式同样适用于 您可以直接询问git,其中(本地)分支包含您的提交,如下所示:
git branch --contains ab123456
$ c $
<$>使用-r选项查询远程分支,如下所示: p $ p $ git branch -r --contains ab123456
h3>
正如Andrew C.所评论的,这实际上是正确且精心地由VonC回答。
注意
我现在看到Sulli也提供了同样的答案在这个线程中。
I have a random feature/XXXXXXX branch that has some commits and naturally the "develop" branch where those features are eventually merged.
How do I check if a certain old commit (e.g. commit ab123456 from branch feature/user-registration) has been somehow brought/merged to my currently active branch (e.g. develop)? Either by directly merging the feature branch to develop or by going up/merged through some other intermediary branch.
Through git commands or through SourceTree UI, both ways are equally suitable for me.
Solution
You can ask git directly, which (local) branches contain your commit, like so:
git branch --contains ab123456
use the "-r" option to query for remote branches, like so:
git branch -r --contains ab123456
References
As Andrew C. comments, this is practically a duplicate of How to list branches that contain a given commit? correctly and elaborately answered by VonC.
Note
I now see that Sulli also provides the same answer in this thread.
这篇关于如何检查提交是否已合并到我当前的分支 - 在某个时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!