Very similar question as this one: Export only modified and added files with folder structure in Git
The given answer only seems to output the files changed in the given commit ($commit_id):
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $commit_id
I’d like to get the list of modified files between commit1 and commit2… Is this possible?
You should just be able to use the commit IDs. For example:
If you want to include the changes in commit
3ef44d29dthen you need to specify its parent either by ID or with3ef44d29d^.Here are some examples, from one of my own projects. Going backwards in history, I have the following commits:
I get the following output from various commands:
I can get all the changes between
c46bacand1a443easily enough:But notice that it doesn’t include the change to
public/index.phpin commitc46bac. What we really want is to use the parent of that commit as our starting point for comparison.