Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

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

Which command should I use?

1 Answer

0 votes
by (50.2k points)

The command that you can use to see the file names that changed between two commits according to the question is

git diff --name-only SHA1 SHA2

Also, you can use to see the difference between any latest commands using 

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

Here this command will help you to see the file names between tenth latest commit and fifth latest commit.

And also you can use git show command for having the file name of SHA1 and SHA2 separately using 

 git show --name-only SHA1

git show --name-only SHA2

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...