See what will be combined into one git command?

Currently, before merging a branch, I use the following commands to see what changes will be merged:

base=$(git merge-base other HEAD) git diff $base other 

Is there one git command to achieve this?

Regards, Jochen

+7
git merge
source share
2 answers
 git diff ...other 
+7
source share

Note: the question “ How do I preview the merge preview in git? ” Indicates the context of the preview of what will be merged upon extraction:

 [alias] # fetch and show what would be merged (use option "-p" to see patch) incoming = "!git remote update -p; git log ..@{u}" 

FROM

  • " git incoming " to show a lot of changes or
  • " git incoming -p " to show the patch (i.e. "diff"),
  • " git incoming --pretty=oneline ", for a brief summary, etc.

You can find more complex scenarios in this:

+1
source share