Autogenerated man pages for v1.3.3-ged90
[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 \fIgit\-diff\fR [ \-\-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  \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\&.
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 .nf
60 $ git diff            \fB(1)\fR
61 $ git diff \-\-cached   \fB(2)\fR
62 $ git diff HEAD       \fB(3)\fR
63 .fi
64 .sp
65 \fB1. \fRchanges in the working tree since your last git\-update\-index\&.
66 .br
67 \fB2. \fRchanges between the index and your last commit; what you would be committing if you run "git commit" without "\-a" option\&.
68 .br
69 \fB3. \fRchanges in the working tree since your last commit; what you would be committing if you run "git commit \-a"
70 .br
71
72
73 .TP
74 Comparing with arbitrary commits
75
76 .nf
77 $ git diff test            \fB(1)\fR
78 $ git diff HEAD \-\- \&./test  \fB(2)\fR
79 $ git diff HEAD^ HEAD      \fB(3)\fR
80 .fi
81 .sp
82 \fB1. \fRinstead of using the tip of the current branch, compare with the tip of "test" branch\&.
83 .br
84 \fB2. \fRinstead of comparing with the tip of "test" branch, compare with the tip of the current branch, but limit the comparison to the file "test"\&.
85 .br
86 \fB3. \fRcompare the version before the last commit and the last commit\&.
87 .br
88
89
90 .TP
91 Limiting the diff output
92
93 .nf
94 $ git diff \-\-diff\-filter=MRC            \fB(1)\fR
95 $ git diff \-\-name\-status \-r             \fB(2)\fR
96 $ git diff arch/i386 include/asm\-i386   \fB(3)\fR
97 .fi
98 .sp
99 \fB1. \fRshow only modification, rename and copy, but not addition nor deletion\&.
100 .br
101 \fB2. \fRshow only names and the nature of change, but not actual diff output\&. \-\-name\-status disables usual patch generation which in turn also disables recursive behaviour, so without \-r you would only see the directory name if there is a change in a file in a subdirectory\&.
102 .br
103 \fB3. \fRlimit diff output to named subtrees\&.
104 .br
105
106
107 .TP
108 Munging the diff output
109
110 .nf
111 $ git diff \-\-find\-copies\-harder \-B \-C  \fB(1)\fR
112 $ git diff \-R                          \fB(2)\fR
113 .fi
114 .sp
115 \fB1. \fRspend extra cycles to find renames, copies and complete rewrites (very expensive)\&.
116 .br
117 \fB2. \fRoutput diff in reverse\&.
118 .br
119
120
121 .SH "AUTHOR"
122
123
124 Written by Linus Torvalds <torvalds@osdl\&.org>
125
126 .SH "DOCUMENTATION"
127
128
129 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
130
131 .SH "GIT"
132
133
134 Part of the \fBgit\fR(7) suite
135