GIT – List modified files between revisions

As a GIT user, I need to know what files are modified between revisions before uploading it to a live server where no sort of revision control is possible. Since I do a lot of small commits, revision range will be several commits away from HEAD, before it gets into production.

First, we need to know the revision id. If we are using the latest, then the end range id is obviously HEAD. To get the start range ID, I use gitk and look for the start commit and look for the sha1 commit id. Once I get the Id, listing the modified files is simple as:

git diff --name-only startid HEAD
# or for non head
git diff --name-only startid endid

Then you will get a long list of files modified between those revisions.

1 thought on “GIT – List modified files between revisions”

Leave a reply

Your email address will not be published. Required fields are marked *