Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

List all files touched by commits in git

How to list all the files that were "touched" somewhere between two commits? I am looking for a command similar to git diff COMMIT1..COMMIT2 --name-only but including the files that were modified and reverted later.

For example, let’s say I have a repository with a series of commits (linear history): C0->C1->C2->C3->C4. The commit C1 introduced a new file F and then the commit C3 removed it from the repository. I am looking for a command that, given C0 and C4, would tell me that somewhere in between there was a file F. Even though there is no such file in C0 and in C4. Therefore git diff wouldn’t mention file F at all.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

git diff ref1 ref2 takes into account only given commits, yes, but git log will find the missing steps and list files for each one, which sort will aggregate :

git log --pretty=format:"" --name-only COMMIT1..COMMIT2 | sort -u
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading