The difference between branches
Checking the difference between branches can show valuable information before merging.
A regular Git diff between two branches will show you all the information, but it can be rather exhausting to sit and look at; maybe you are only interested in one file. Thus, you don't need the long unified diff.
Getting ready
To start with, we decide on two branches, tags, or commits we want to see the diff between. Then, to list files that have changed between these branches, you can use the --name-only
flag.
How to do it…
Perform the following steps to see the difference between the branches:
Diff the
origin/stable-3.1
withorigin/stable-3.2
branch:$ git diff --name-only origin/stable-3.1 origin/stable-3.2 org.eclipse.jgit/src/org/eclipse/jgit/transport/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetch More output..
We are building the command in this pattern, that is,
git diff [options] <commit> <commit> <path>
. Then, we can diff what we care...