1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
10 .de Sp \" Vertical space (when we can't use .PP)
16 .ie \\n(.$>=3 .ne \\$3
20 .TH "GIT-DIFF" 1 "" "" ""
22 git-diff \- Show changes between commits, commit and working tree, etc.
26 git\-diff [ \-\-diff\-options ] <ent>{0,2} [<path>...]
31 Show changes between two ents, an ent and the working tree, an ent and the index file, or the index file and the working tree\&. The combination of what is compared with what is determined by the number of ents given to the command\&.
35 When no <ent> is given, the working tree and the index file is compared, using git\-diff\-files\&.
38 When one <ent> is given, the working tree and the named tree is compared, using git\-diff\-index\&. The option \-\-cached can be given to compare the index file and the named tree\&.
41 When two <ent>s are given, these two trees are compared using git\-diff\-tree\&.
48 \-\-diff\-options are passed to the git\-diff\-files, git\-diff\-index, and git\-diff\-tree commands\&. See the documentation for these commands for description\&.
52 The <path> arguments are also passed to git\-diff\-* commands\&.
57 Various ways to check your working tree
64 changes in the working tree since your last git\-update\-index\&.
65 changes between the index and your last commit; what you
66 would be committing if you run "git commit" without "\-a" option\&.
67 changes in the working tree since your last commit; what you
68 would be committing if you run "git commit \-a"
70 Comparing with arbitrary commits
74 $ git diff HEAD \-\- \&./test
77 instead of using the tip of the current branch, compare with the
78 tip of "test" branch\&.
79 instead of comparing with the tip of "test" branch, compare with
80 the tip of the current branch, but limit the comparison to the
82 compare the version before the last commit and the last commit\&.
84 Limiting the diff output
87 $ git diff \-\-diff\-filter=MRC
88 $ git diff \-\-name\-status \-r
89 $ git diff arch/i386 include/asm\-i386
91 show only modification, rename and copy, but not addition
93 show only names and the nature of change, but not actual
94 diff output\&. \-\-name\-status disables usual patch generation
95 which in turn also disables recursive behaviour, so without \-r
96 you would only see the directory name if there is a change in a
97 file in a subdirectory\&.
98 limit diff output to named subtrees\&.
100 Munging the diff output
103 $ git diff \-\-find\-copies\-harder \-B \-C
106 spend extra cycles to find renames, copies and complete
107 rewrites (very expensive)\&.
108 output diff in reverse\&.
112 Written by Linus Torvalds <torvalds@osdl\&.org>
117 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
122 Part of the \fBgit\fR(7) suite