Syntax
|
git diff [options] <commit>[..<commit>] [--] [<path>...] |
Option |
Description |
options |
The differen options that can be used to report the differences |
commit |
An arbitrary commit/branch to be compared. |
commit |
The second commit/branch to be compared, if omitted then HEAD (of the current branch) is used. |
path... |
If path is specified, then the comparison happens at the file level instead of commit/branch level. |
Note: common options are
--minimal, spend extra time to make sure the smallest possible diff is produced.
--summary, output a condensed summary of extended header information such as creations, renames and mode changes.
--name-only, show only names of changed files.
--name-status, show only names and status of changed files.
--diff-filter, select only files that are:
Added (A)
Copied (C)
Deleted (D)
Modified (M)
Renamed (R)
Changed (T)
Unmerged (U)
Unknown (X)
airing Broken (B)
Example
|
# get delta between HEAD and origin/master displaying status and name of the files |
|
git diff --name-status origin/master |
|
|
|
# get delta between HEAd and origin/master displaying status and name of the files and showing only added files |
|
git diff --name-status --diff-filter A origin/master |
References
git-diff