我如何看到git中分支之间的提交差异? [英] How do I see the commit differences between branches in git?
本文介绍了我如何看到git中分支之间的提交差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在分支-X上添加了更多的提交。我想看看MASTER和我在提交方面的分支之间的所有区别。我可以做一个
I'm on branch-X and have added a couple more commits on top of it. I want to see all the differences between MASTER and the branch that I am on in terms of commits. I could just do a
git checkout master
git log
然后一个
and then a
git checkout branch-X
git log
并在视觉上区分这些,但我希望更轻松,更少错误-prone method。
and visually diff these, but I'm hoping for an easier, less error-prone method.
推荐答案
您可以获得非常好的视觉输出, b
$ b
You can get a really nice, visual output of how your branches differ with this
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative master..branch-X
这篇关于我如何看到git中分支之间的提交差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文