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.
To start with, we decide on two branches, tags, or commits we want to see the difference between. Then, to list files that have changed between these branches, you can use the--name-only
flag.
Perform the following steps to see the difference between the branches:
- Diff
origin/stable-3.1
with theorigin/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...