如何在远程分支合并之前检查真正的git diff? [英] How to check real git diff before merging from remote branch?
问题描述
我想检查远程分支和本地分支之间的真正差异。我怎么能做到这一点?
I want to check the real diff between remote branch and local branch. How can I do that?
发出下面的命令部分起作用,但它也显示了我本地分支的新变化的差异。
Issuing the below command partially works, but it shows the diff of the new changes of my local branch too.
git diff remote/branch
推荐答案
从文档:
From the documentation:
git diff [--options] <commit>...<commit> [--] [<path>…]
这种形式是查看
包含并高达
秒的<< $ c $< ;提交>
。 git diff
A ... B相当于git diff
$(git-merge-base A B)B。您可以省略
任何一个< commit>
,其中
具有与使用HEAD相同的效果。
This form is to view the changes on
the branch containing and up to the
second <commit>
, starting at a common
ancestor of both <commit>
. "git diff
A...B" is equivalent to "git diff
$(git-merge-base A B) B". You can omit
any one of <commit>
, which has the
same effect as using HEAD instead.
你试过这个吗?
这篇关于如何在远程分支合并之前检查真正的git diff?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!