blob: c0b308070b671ba0ca58beeac53b259bda102fa7 [file] [log] [blame]
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00001'\" t
2.\" Title: git-upstream-diff
3.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
Robert Iannuccieb5f85b2018-06-21 19:41:31 +00004.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
5.\" Date: 06/20/2018
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00006.\" Manual: Chromium depot_tools Manual
Robert Iannuccieb5f85b2018-06-21 19:41:31 +00007.\" Source: depot_tools 79d42dfb
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00008.\" Language: English
9.\"
Robert Iannuccieb5f85b2018-06-21 19:41:31 +000010.TH "GIT\-UPSTREAM\-DIFF" "1" "06/20/2018" "depot_tools 79d42dfb" "Chromium depot_tools Manual"
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000011.\" -----------------------------------------------------------------
12.\" * Define some portability stuff
13.\" -----------------------------------------------------------------
14.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15.\" http://bugs.debian.org/507673
16.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18.ie \n(.g .ds Aq \(aq
19.el .ds Aq '
20.\" -----------------------------------------------------------------
21.\" * set default formatting
22.\" -----------------------------------------------------------------
23.\" disable hyphenation
24.nh
25.\" disable justification (adjust text to left margin only)
26.ad l
27.\" -----------------------------------------------------------------
28.\" * MAIN CONTENT STARTS HERE *
29.\" -----------------------------------------------------------------
30.SH "NAME"
31git-upstream-diff \- Print a diff of the current branch, compared to its upstream\&.
32.SH "SYNOPSIS"
33.sp
34.nf
Robert Iannuccieb5f85b2018-06-21 19:41:31 +000035\fIgit upstream\-diff\fR [\-\-wordwise] [\-\-branch branch] [<extra args for git\-diff>*]
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000036.fi
37.sp
38.SH "DESCRIPTION"
39.sp
Robert Iannuccieb5f85b2018-06-21 19:41:31 +000040Shows a diff between a branch and its upstream\&. If the \-\-branch option is omitted or "HEAD", the tool shows the diff for the current branch\&. Any additional arguments are passed through to the underlying git\-diff command\&. This is \fIroughly\fR the same as:
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000041.sp
42.if n \{\
43.RS 4
44.\}
45.nf
Matt Mueller89734302017-11-03 14:37:23 -070046git diff \-\-patience \-C \-C branch@{upstream} \fB(1)\fR \fB(2)\fR
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000047.fi
48.if n \{\
49.RE
50.\}
51.sp
52.sp
53\fB1. \fR\-C \-C
54detects file copies/renames
55.br
56\fB2. \fR\-\-patience
57uses the patience\-diff algorithm, which tends to produce nicer diffs in many cases\&.
58.br
59.sp
Matt Mueller89734302017-11-03 14:37:23 -070060The difference is that branch@{upstream} is actually the tagged merge base of your branch (See \fBgit-rebase-update\fR(1))\&. This means that if your upstream branch was rebased, but you haven\(cqt yet rebased the current branch on top of it, you\(cqll still see an accurate diff compared to just diffing against @{upstream}\&.
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000061.sp
62The \-\-wordwise option also allows git\-diff to do word\-by\-word comparison in a semi\-intelligent way\&. However, sometimes it can produce surprising results, so it is disabled by default\&.
Robert Iannuccieb5f85b2018-06-21 19:41:31 +000063.sp
64Since any additional options are passed through to git\-diff unchanged, you can use this as a general replacement for git diff for things like:
65.sp
66.if n \{\
67.RS 4
68.\}
69.nf
70$ # See what changed in a file on the current branch
71$ git upstream\-diff some/file\&.py
72\&.\&.\&.
73
74$ # Omit deleted files from the diff
75$ git upstream\-diff \-\-diff\-filter d
76\&.\&.\&.
77
78$ # etc\&.
79.fi
80.if n \{\
81.RE
82.\}
83.sp
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000084.SH "OPTIONS"
85.PP
86\-\-wordwise
87.RS 4
88Print a colorized word\-wise diff instead of a line\-wise diff\&.
Matt Mueller89734302017-11-03 14:37:23 -070089.sp
90.if n \{\
91.RS 4
92.\}
93.nf
94Show a diff between the specified branch and its upstream, instead of using
95the current branch\&.
96.fi
97.if n \{\
98.RE
99.\}
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +0000100.RE
101.PP
102<extra args for git\-diff>
103.RS 4
104Extra arguments are included in the invocation of
105\fBgit-diff\fR(1)\&. These can be anything that
106git\-diff
107normally takes\&.
108.PP
109\-\-stat
110.RS 4
111This is particularly useful to show
112\fIwhich\fR
113files have been changed in comparison to the upstream branch\&.
114.RE
115.PP
iannucci@chromium.org5c7e5b32014-05-08 19:20:10 +0000116\-\-staged
117.RS 4
118Diff against the staged (cached) changes, instead of against the working directory\&. This is
119\fIsubstantially\fR
120faster on large repos, but doesn\(cqt take into account unstaged changes (i\&.e\&. changes in your working copy which you haven\(cqt staged with
121git add)\&.
122.RE
123.PP
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +0000124\-\- <filename patterns>*
125.RS 4
126Restrict the diff to only show the diff for given files compared to the upstream\&.
127.RE
128.RE
129.SH "CONFIGURATION VARIABLES"
130.SS "depot\-tools\&.upstream\-diff\&.default\-args"
131.sp
132A list\-configuration variable\&. Each instance of this config variable will be prepended to all invocations of git upstream\-diff, as if you had passed them on the command line\&.
133.SH "SUGGESTED ALIASES"
134.sp
135Some common short\-hand aliases\&. Feel free to add these to your \fI~/\&.gitconfig\fR file\&.
136.sp
137.if n \{\
138.RS 4
139.\}
140.nf
141[alias]
142 git udiff = upstream\-diff
143.fi
144.if n \{\
145.RE
146.\}
147.sp
148.SH "SEE ALSO"
149.sp
150\fBgit-rebase-update\fR(1)
151.SH "CHROMIUM DEPOT_TOOLS"
152.sp
iannucci@chromium.org21980022014-04-11 04:51:49 +0000153Part of the chromium \fBdepot_tools\fR(7) suite\&. These tools are meant to assist with the development of chromium and related projects\&. Download the tools from \m[blue]\fBhere\fR\m[]\&\s-2\u[1]\d\s+2\&.
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +0000154.SH "NOTES"
155.IP " 1." 4
156here
157.RS 4
Quinten Yearsley442fb642016-12-15 15:38:27 -0800158\%https://chromium.googlesource.com/chromium/tools/depot_tools.git
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +0000159.RE