我怎样才能找到所有提交在一个分支,但没有在另一个使用Git? [英] How can I find all commits that are in one branch but not in another using git?

查看:65
本文介绍了我怎样才能找到所有提交在一个分支,但没有在另一个使用Git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个分支, master live Master 是开发
分支,包含未准备好进入 live 的提交。


  • 如果在需要进入
    live 分支的 master 分支中进行更改,那么它们是从 live 。。
  • $ b樱桃选入 master 或合并为 master


希望能够做到的是查看 master 中所有不在 live 中的提交,我已经在这里进行了很好的搜索,而Google和我是使用此:

  git log --cherry-pick --no-merges --oneline master ... live 

直到我将 live 合并到 master 中为止。但现在它列出了两个提交。



那么查看 master 分支中的所有提交以及不在 live 分支中?

解决方案

我最终用一个简短的python脚本解决了我自己的问题结合git patch-id和git log,脚本可以在这里找到 https://gist.github.com/4565584


I've two branches, master and live. Master is the development branch and contains commits that aren't ready to go into live.

  • If a change is made in the master branch that needs to go into the live branch then they're cherry picked from master to live.
  • Sometimes commits are made to the live branch that are then either cherry picked into master or merged into master.

What I want to be able to do is view all the commits that are in master than aren't in live, I've had a good search on here and Google and I was using this:

git log --cherry-pick --no-merges --oneline master...live

This worked until I merged live into master. But now it lists several commits that are in both.

So what is the correct command to view all commits that are in the master branch and not in the live branch?

解决方案

I ended up solving my own problem using a short python script combining git patch-id and git log, the script can be found here https://gist.github.com/4565584

这篇关于我怎样才能找到所有提交在一个分支,但没有在另一个使用Git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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