I'm trying to get a list of changed/added/deleted/etc. files for a commit in my Git repository. When I run the following in the shell, this is the output:
Indragie$ /usr/bin/git diff --name-status 0836
D INPopoverController.h
D INPopoverController.m
D INPopoverControllerDefines.h
D INPopoverWindow.h
D INPopoverWindow.m
D INPopoverWindowFrame.h
D Images/blue_progress_slice.png
M Images/next.png
M Images/pause.png
M Images/play.png
M Images/previous.png
D Images/progress_left_cap.png
When I check the list of changes in Xcode (or any other third party Git client), I see this:
Xcode diff http://cl.ly/2i3P3s0m0i3I10110h3E/Screen_Shot_2011-04-07_at_8.59.18_PM.png
Obviously these are just excerpts of the larger lists, but the point is that they are not the same at all. I've verified that the SHA1 hash of the commit I'm looking at is the same in both the CLI git and in Xcode. I'm new to git so there might be something fairly obvious I'm doing wrong, b开发者_C百科ut even after pouring over man pages and git tutorials, I can't seem to find where I'm going wrong. Any help is appreciated.
Are you sure you're looking at the same things?
git diff <commit-id>
will show you the differences between your current working tree and the tree at the time of that commit, not the changes introduced by that commit.
git show
would show you just that commit's changes.
精彩评论