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 \fIgit\-diff\fR [ \-\-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 \fI\-\-diff\-options\fR 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"
72 Comparing with arbitrary commits
76 $ git diff HEAD \-\- \&./test
79 instead of using the tip of the current branch, compare with the
80 tip of "test" branch\&.
81 instead of comparing with the tip of "test" branch, compare with
82 the tip of the current branch, but limit the comparison to the
84 compare the version before the last commit and the last commit\&.
88 Limiting the diff output
91 $ git diff \-\-diff\-filter=MRC
92 $ git diff \-\-name\-status \-r
93 $ git diff arch/i386 include/asm\-i386
95 show only modification, rename and copy, but not addition
97 show only names and the nature of change, but not actual
98 diff output\&. \-\-name\-status disables usual patch generation
99 which in turn also disables recursive behaviour, so without \-r
100 you would only see the directory name if there is a change in a
101 file in a subdirectory\&.
102 limit diff output to named subtrees\&.
106 Munging the diff output
109 $ git diff \-\-find\-copies\-harder \-B \-C
112 spend extra cycles to find renames, copies and complete
113 rewrites (very expensive)\&.
114 output diff in reverse\&.
120 Written by Linus Torvalds <torvalds@osdl\&.org>
125 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
130 Part of the \fBgit\fR(7) suite