Can I get a list of changed files in a git sub-folder between two commits?
I have a git repo containing many folders. I need to find out what fi开发者_JS百科les have changed in one of those folders between two commits.
Is there a nice way of doing this?
I think you can just stick the path at the end of git diff
.
git diff HEAD^ HEAD special_folder/
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.
I believe the nicest way to do it is to use git-gui.
I'm using a rather old version, but here's what works for me: Select "visualize all branch history" from the Repository menu, and select the later of the two commits on the nice graphical pane in the upper left.
The other panes should display all kinds of information on what changed in that checkin, to just about any level of detail a developer could want.
To see for a particular folder, go to the pane in the lower right, select the Patch button (to get rid of unchanged stuff) and navigate down to the folder you are interested in. You can select individual changed files to view the diffs in the pane on the lower left.
精彩评论