Suppressing diffs for deleted files in git
git diff -D
(or equivalently git diff --irreversible-delete
) will omit the diff body for deleted files. I don't think there's an equivalent for added files.
Almost same answer as posted Dan Moulding
, but you probably want to specify what you don't want to show, and for hide deleted files it will be:
git diff --diff-filter=d
You also may use -M which try to find files that was moved
git diff -M -D
more may get more info with: git diff --help (option -B also could be interesting)
In Git versions 1.8.5 and newer, you can do this using the --diff-filter
option and specifying "d" (lowercase) to tell it to exclude deleted files.
$ git diff --diff-filter=d
In Git versions older than 1.8.5, you can do this with the --diff-filter
option and specifying all but the "D" (deleted) criteria:
$ git diff --diff-filter=ACMRTUXB