Autogenerated man pages for v1.1.5-g36b5
[git.git] / man1 / git-diff.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "GIT-DIFF" 1 "" "" ""
21 .SH NAME
22 git-diff \- Show changes between commits, commit and working tree, etc.
23 .SH "SYNOPSIS"
24
25
26 git\-diff [ \-\-diff\-options ] <ent>{0,2} [<path>...]
27
28 .SH "DESCRIPTION"
29
30
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\&.
32
33 .TP 3
34 \(bu
35 When no <ent> is given, the working tree and the index file is compared, using git\-diff\-files\&.
36 .TP
37 \(bu
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\&.
39 .TP
40 \(bu
41 When two <ent>s are given, these two trees are compared using git\-diff\-tree\&.
42 .LP
43
44 .SH "OPTIONS"
45
46 .TP
47 \-\-diff\-options
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\&.
49
50 .TP
51 <path>...
52 The <path> arguments are also passed to git\-diff\-* commands\&.
53
54 .SH "EXAMPLES"
55
56 .TP
57 Various ways to check your working tree
58
59 .IP
60 $ git diff 
61 $ git diff \-\-cached 
62 $ git diff HEAD 
63
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"
69 .TP
70 Comparing with arbitrary commits
71
72 .IP
73 $ git diff test 
74 $ git diff HEAD \-\- \&./test 
75 $ git diff HEAD^ HEAD 
76
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
81 file "test"\&.
82  compare the version before the last commit and the last commit\&.
83 .TP
84 Limiting the diff output
85
86 .IP
87 $ git diff \-\-diff\-filter=MRC 
88 $ git diff \-\-name\-status \-r 
89 $ git diff arch/i386 include/asm\-i386 
90
91  show only modification, rename and copy, but not addition
92 nor deletion\&.
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\&.
99 .TP
100 Munging the diff output
101
102 .IP
103 $ git diff \-\-find\-copies\-harder \-B \-C 
104 $ git diff \-R 
105
106  spend extra cycles to find renames, copies and complete
107 rewrites (very expensive)\&.
108  output diff in reverse\&.
109 .SH "AUTHOR"
110
111
112 Written by Linus Torvalds <torvalds@osdl\&.org>
113
114 .SH "DOCUMENTATION"
115
116
117 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
118
119 .SH "GIT"
120
121
122 Part of the \fBgit\fR(7) suite
123