比较 Git 中的两个分支?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9834689/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 13:17:44 来源:igfitidea点击:
Comparing two branches in Git?
提问by isuruanu
I have two branches, branch_1
and branch_2
.
我有两个分支,branch_1
和branch_2
.
I want to see the differences between the two branches in Git.
我想在 Git 中查看两个分支之间的差异。
回答by Lazy Badger
git diff branch_1..branch_2
That will produce the diff between the tips of the two branches. If you'd prefer to find the diff from their common ancestor to test, you can use three dots instead of two:
这将在两个分支的尖端之间产生差异。如果您希望从它们的共同祖先中找到差异进行测试,您可以使用三个点而不是两个点:
git diff branch_1...branch_2