Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list only the names of files that changed between two commits

I have a bunch of commits in the repository. I want to see a list of files changed between two commits - from SHA1 to SHA2.

What command should I use?

like image 243
Shawn Avatar asked Oct 12 '09 01:10

Shawn


People also ask

How do you find a list of files that have changed in a particular commit?

Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command.

Which command would you use in order to list files that have any changes when compared to the last commit?

You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit.

How do I see changes between commits?

To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..


1 Answers

git diff --name-only SHA1 SHA2 

where you only need to include enough of the SHA hash to identify the commits. You can also do, for example

git diff --name-only HEAD~10 HEAD~5 

to see the differences between the tenth latest commit and the fifth latest (or so).

like image 74
Peter Avatar answered Oct 09 '22 06:10

Peter