如何查看一个分支中的哪些提交不在另一个分支中? [英] How to see which commits in one branch aren't in the other?

查看:90
本文介绍了如何查看一个分支中的哪些提交不在另一个分支中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个分支 devel 下一个。在devel中,我有一个或多或少的大量提交。一些提交是在下一个中挑选的。此外,我添加了一些提交到下一个合并到 devel



现在我想查看缺少的内容在 next 中,所以我可以在将它们带到 next 之前详细测试这些更改。我的问题是现在,我怎么能看到哪些提交是在 devel 中,但在接下来没有? 尚未被樱桃采摘。 git cherry 的文档是 here ,但总之,你应该能够做到:

  git checkout devel 
git cherry下一个

...并且看到输出有点像这样:

'pre> + 492508acab7b454eee8b805f8ba906056eede0ff
- 5ceb5a9077ddb9e78b1e8f24bfc70e674c627949
+ b4459544c000f4d51d1ec23f279d9cdb19c1d32b
+ b6ce3b78e938644a293b2dd2a15b2fecb1b54cd9

+ 开头的提交将是您尚未提交的提交樱桃选中下一步。在这种情况下,我至今只挑选了一个提交。您可能希望将 -v 参数添加到 git cherry 命令中,以便它还输出主题行每次提交。


I have two branches devel and next. In devel I have a more or less huge amount of commits. Some of the commits are cherry picked in next. Also I added some commits to next which are merged to devel.

Now I would like to see what is missing in next, so I can test the changes in detail before bringing them to next. My question is now, how can I see which commits are in devel but not in next?

解决方案

The little-used command git cherry shows you the commits which haven't yet been cherry-picked. The documentation for git cherry is here, but, in short, you should just be able to do:

git checkout devel
git cherry next

... and see output a bit like this:

+ 492508acab7b454eee8b805f8ba906056eede0ff
- 5ceb5a9077ddb9e78b1e8f24bfc70e674c627949
+ b4459544c000f4d51d1ec23f279d9cdb19c1d32b
+ b6ce3b78e938644a293b2dd2a15b2fecb1b54cd9

The commits that begin with + will be the ones that you haven't yet cherry-picked into next. In this case, I'd only cherry-picked one commit so far. You might want to add the -v parameter to the git cherry command, so that it also outputs the subject line of each commit.

这篇关于如何查看一个分支中的哪些提交不在另一个分支中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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