Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get a list of changed files in a git sub-folder between two commits?

Tags:

git

I have a git repo containing many folders. I need to find out what files have changed in one of those folders between two commits.

Is there a nice way of doing this?

like image 610
Neil Middleton Avatar asked Feb 11 '10 14:02

Neil Middleton


2 Answers

I think you can just stick the path at the end of git diff.

git diff HEAD^ HEAD special_folder/
like image 115
Matchu Avatar answered Oct 11 '22 21:10

Matchu


git diff has an option to do just what you want

git diff --name-status OLD NEW.

There are several options to get just what you want:

git diff --stat OLD NEW.     #show graphically how much changed.
git diff --numstat OLD NEW.  #show numerically how much changed.

You might also want to consider: -M to show renames and -C to show copies.

like image 23
Kyle Butt Avatar answered Oct 11 '22 22:10

Kyle Butt