使用Git,显示一个分支中的所有提交,但不显示其他分支 [英] Using Git, show all commits that are in one branch, but not the other(s)

查看:222
本文介绍了使用Git,显示一个分支中的所有提交,但不显示其他分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个旧分支,我想删除它。但是,在这样做之前,我想检查对此分支所做的所有提交是否在某个点合并到了其他分支。因此,我希望看到对当前分支所做的所有未提交给其他分支的提交[或者,如果没有某个脚本,这是不可能的,那么如何看一个分支中所有未提交的提交到另一个给定的分支?]。

解决方案

您可能只想要

  git branch  - 包含分支到删除

将列出包含来自分支 - 删除的提交的所有分支。
如果它报告的不仅仅是分支到删除,那么分支已经被合并了。


你的选择实际上就是rev-list语法。例如 git log one-branch..another-branch 显示一分支需要的所有东西 another-branch has。



您可能对 git show-branch 作为看看究竟在哪里的一种方法。


I have an old branch, which I would like to delete. However, before doing so, I want to check that all commits made to this branch were at some point merged into some other branch. Thus, I'd like to see all commits made to my current branch which have not been applied to any other branch [or, if this is not possible without some scripting, how does one see all commits in one branch which have not been applied to another given branch?].

解决方案

You probably just want

git branch --contains branch-to-delete

This will list all branches which contain the commits from "branch-to-delete". If it reports more than just "branch-to-delete", the branch has been merged.

Your alternatives are really just rev-list syntax things. e.g. git log one-branch..another-branch shows everything that one-branch needs to have everything another-branch has.

You may also be interested in git show-branch as a way to see what's where.

这篇关于使用Git,显示一个分支中的所有提交,但不显示其他分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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