0 votes
in Git by
How can we find a list of files changed in a specific commit?

1 Answer

0 votes
by

Candidates would find practical questions like this among the most popular Git interview questions. The answer is quite simple! Just use the command ‘git diff-tree -r {hash}”. The ‘-r’ flag helps in listing the individual files. The output can contain some additional information. However, you can downplay the extra information with the help of two additional flags. The command with the additional flags would be “git diff-tree –no-commit-id –name-only -r {hash}.” The –no-commit-id helps in suppressing the commit hashes from the output. The “–name-only” flag helps in printing the file names rather than the paths.

...