blob: cd76c5b967fb536d8d3fa06f0ccde30ee62c07c8 [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/>
Daniel McArdle43c083d2019-05-03 18:02:45 +00005.\" Date: 05/03/2019
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00006.\" Manual: Chromium depot_tools Manual
Daniel McArdle43c083d2019-05-03 18:02:45 +00007.\" Source: depot_tools e58cce6c
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00008.\" Language: English
9.\"
Daniel McArdle43c083d2019-05-03 18:02:45 +000010.TH "GIT\-UPSTREAM\-DIFF" "1" "05/03/2019" "depot_tools e58cce6c" "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.RE
Daniel McArdle43c083d2019-05-03 18:02:45 +000090.PP
91\-\-branch branch
92.RS 4
93Show a diff between the specified branch and its upstream, instead of using the current branch\&.
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000094.RE
95.PP
96<extra args for git\-diff>
97.RS 4
98Extra arguments are included in the invocation of
99\fBgit-diff\fR(1)\&. These can be anything that
100git\-diff
101normally takes\&.
102.PP
103\-\-stat
104.RS 4
105This is particularly useful to show
106\fIwhich\fR
107files have been changed in comparison to the upstream branch\&.
108.RE
109.PP
iannucci@chromium.org5c7e5b32014-05-08 19:20:10 +0000110\-\-staged
111.RS 4
112Diff against the staged (cached) changes, instead of against the working directory\&. This is
113\fIsubstantially\fR
114faster on large repos, but doesn\(cqt take into account unstaged changes (i\&.e\&. changes in your working copy which you haven\(cqt staged with
115git add)\&.
116.RE
117.PP
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +0000118\-\- <filename patterns>*
119.RS 4
120Restrict the diff to only show the diff for given files compared to the upstream\&.
121.RE
122.RE
123.SH "CONFIGURATION VARIABLES"
124.SS "depot\-tools\&.upstream\-diff\&.default\-args"
125.sp
126A 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\&.
127.SH "SUGGESTED ALIASES"
128.sp
129Some common short\-hand aliases\&. Feel free to add these to your \fI~/\&.gitconfig\fR file\&.
130.sp
131.if n \{\
132.RS 4
133.\}
134.nf
135[alias]
136 git udiff = upstream\-diff
137.fi
138.if n \{\
139.RE
140.\}
141.sp
142.SH "SEE ALSO"
143.sp
144\fBgit-rebase-update\fR(1)
145.SH "CHROMIUM DEPOT_TOOLS"
146.sp
iannucci@chromium.org21980022014-04-11 04:51:49 +0000147Part 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 +0000148.SH "NOTES"
149.IP " 1." 4
150here
151.RS 4
Quinten Yearsley442fb642016-12-15 15:38:27 -0800152\%https://chromium.googlesource.com/chromium/tools/depot_tools.git
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +0000153.RE