git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $commit_id
-
git diff-tree -r $commit_id
:Take a diff of the given commit to its parent(s) (including all subdirectories, not just the top directory).
-
--no-commit-id --name-only
:Do not output the commit SHA1. Output only the names of the affected files instead of a full diff.
-
--diff-filter=ACMRT
:Only show files added, copied, modified, renamed or that had their type changed (eg. file → symlink) in this commit. This leaves out deleted files.
UPDATE FROM THE COMMENT:
Base on the question context and the comments below, with the following command, you can get the ACMRT
files as a .tar
file with their folder structure.
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $commit_id | tar -czf file.tgz -T -