I am studying git repositories. I want to get a list of modified files in each commit.
So what I did, I visited every commit with the command
git reset
Then i used
git show --pretty="format:" --name-only
The problem with this is that it gives deleted files in this commitId, which I don't want. I also tried:
git ls-files
it does not return deleted files, however it returns a list of all existing files that are new or were created in a previous commit.
Example:
>commit 1 add "file1" add "file2" >commit 2 change "file1" >commit 3 add "file3" delete "file2"
therefore, in this case I will visit every commit. And, if I am in commit 1, I want to get a list of "file1" and "file2". If I am in commit 2, I will get "file1" and "file3" if I am in commit 3.
Any thought?
source share