git branch-使用管道命令合并 [英] git branch --merged using plumbing commands

查看:76
本文介绍了git branch-使用管道命令合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法实现相当于 git branch --merged 使用git plumbing命令?

Is there a way to achieve the equivalent of git branch --merged using git plumbing commands?

我知道有像git for-each-ref这样的命令,可以为您提供提交哈希值及其对应的引用名称.是否有命令告诉一个提交是否可以从另一个提交到达(基本上是--merged所做的事情)?

I know there are commands like git for-each-ref which gives you the commit hashes and their corresponding ref names. Is there a command to tell whether a commit is reachable from another commit (which is basically what --merged do)?

推荐答案

git merge-base --independent X Y Z会告诉您其中哪些尚未合并到另一个分支.

git merge-base --independent X Y Z will tell you which of those are not yet merged to another branch.

此外,git merge-base --is-ancestor X Y会告诉您X是否是Y的祖先,但这是实现git branch --merged的效率低下的方法,因为您需要为N个分支运行N ^ 2次.

In addition, git merge-base --is-ancestor X Y will tell you whether X is an ancestor of Y, but that's an inefficient way to implement git branch --merged because you'll need to run it N^2 times for N branches.

这篇关于git branch-使用管道命令合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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