acgtyrant
acgtyrant

Reputation: 1829

How to know which files is deleted in a git commit?

I remember that I deleted some files in ede4f9a, now I want to find out what files I have deleted. I tried git show --stat ede4f9a, it shows:

commit ede4f9a13b1ceace01f898dc42d6fa4219690c70
Author: acgtyrant <[email protected]>
Date:   Tue Jun 5 14:46:44 2018 +0800

    lib: deprecate the wrong implementation of bn_sync

 README.md                           |   2 -
 lib/Makefile                        |  30 ----
 lib/build.py                        |  34 ----
 lib/dense/__init__.py               |   0
 lib/dense/batch_norm/__init__.py    |  12 --
 lib/dense/batch_norm/_batch_norm.so | Bin 929208 -> 0 bytes
 lib/dense/batchnormp_kernel.so      | Bin 245056 -> 0 bytes
 lib/functions/__init__.py           |   0
 lib/functions/batchnormp.py         | 146 ------------------
 lib/modules/__init__.py             |   0
 lib/modules/batchnormsync.py        |  64 --------
 lib/src/batchnormp.c                | 159 -------------------
 lib/src/batchnormp.h                |  16 --
 lib/src/batchnormp_cuda.c           |  33 ----
 lib/src/batchnormp_cuda.h           |  16 --
 lib/src/batchnormp_cuda_kernel.cu   | 299 ------------------------------------
 lib/src/batchnormp_cuda_kernel.h    |  16 --
 lib/src/generic/batchnormp_cuda.cu  | 116 --------------
 lib/test.py                         |  54 -------
 19 files changed, 997 deletions(-)

But I can only comfirm that lib/dense/batch_norm/_batch_norm.so and batchnormp_kernel.so are deleted, I do not know is there any other files deleted too while it only mentions the number of files changed and deletions.

Upvotes: 2

Views: 58

Answers (1)

user149341
user149341

Reputation:

The --diff-filter= option will help you out here:

git show --stat --diff-filter=D ede4f9a13b1ceace01f898dc42d6fa4219690c70

This will only list files which were deleted in the commit. (The D stands for "deleted".)

This option also works in git log.

Upvotes: 4

Related Questions