本文介绍了Git:显示分支之间的差异,忽略合并的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的资料库历史记录如下所示:
x --- y - + - z - + - branch
/ / /
--- a --- b --- c - + - d - + - e --- master
我想得到一个单独的diff(即,像'git diff'outputs-我不想像'git log -p'产生的一堆差异)完整的分支历史记录,不包括从主合并到分支中的任何更改。
我该怎么做?
解决方案
您正在寻找的命令是:
git diff master ...分支
从 git help diff
:
My repository history looks something like this:
x---y-+-z-+-branch
/ / /
---a---b---c-+-d-+-e---master
I want to get a single diff (i.e., like 'git diff' outputs- I don't want a whole bunch of diffs like 'git log -p' produces) of the complete history of 'branch', without including any of the changes that were merged into 'branch' from 'master'.
How can I do this?
解决方案
The command you are looking for is:
git diff master...branch
From git help diff
:
这篇关于Git:显示分支之间的差异,忽略合并的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!