blob: 2a2727c20378efc9ef1b1126049fe2d22788b9a1 [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]
4.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
Matt Mueller89734302017-11-03 14:37:23 -07005.\" Date: 11/03/2017
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00006.\" Manual: Chromium depot_tools Manual
Matt Mueller89734302017-11-03 14:37:23 -07007.\" Source: depot_tools 9c2758a5
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +00008.\" Language: English
9.\"
Matt Mueller89734302017-11-03 14:37:23 -070010.TH "GIT\-UPSTREAM\-DIFF" "1" "11/03/2017" "depot_tools 9c2758a5" "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
Matt Mueller89734302017-11-03 14:37:23 -070035\fIgit upstream\-diff\fR [\-\-wordwise] [branch] [<extra args for git\-diff>*]
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000036.fi
37.sp
38.SH "DESCRIPTION"
39.sp
Matt Mueller89734302017-11-03 14:37:23 -070040Shows a diff between a branch and its upstream\&. If the branch is omitted, the tool shows the diff for the current branch\&. 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\&.
63.SH "OPTIONS"
64.PP
65\-\-wordwise
66.RS 4
67Print a colorized word\-wise diff instead of a line\-wise diff\&.
Matt Mueller89734302017-11-03 14:37:23 -070068.sp
69.if n \{\
70.RS 4
71.\}
72.nf
73Show a diff between the specified branch and its upstream, instead of using
74the current branch\&.
75.fi
76.if n \{\
77.RE
78.\}
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +000079.RE
80.PP
81<extra args for git\-diff>
82.RS 4
83Extra arguments are included in the invocation of
84\fBgit-diff\fR(1)\&. These can be anything that
85git\-diff
86normally takes\&.
87.PP
88\-\-stat
89.RS 4
90This is particularly useful to show
91\fIwhich\fR
92files have been changed in comparison to the upstream branch\&.
93.RE
94.PP
iannucci@chromium.org5c7e5b32014-05-08 19:20:10 +000095\-\-staged
96.RS 4
97Diff against the staged (cached) changes, instead of against the working directory\&. This is
98\fIsubstantially\fR
99faster on large repos, but doesn\(cqt take into account unstaged changes (i\&.e\&. changes in your working copy which you haven\(cqt staged with
100git add)\&.
101.RE
102.PP
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +0000103\-\- <filename patterns>*
104.RS 4
105Restrict the diff to only show the diff for given files compared to the upstream\&.
106.RE
107.RE
108.SH "CONFIGURATION VARIABLES"
109.SS "depot\-tools\&.upstream\-diff\&.default\-args"
110.sp
111A 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\&.
112.SH "SUGGESTED ALIASES"
113.sp
114Some common short\-hand aliases\&. Feel free to add these to your \fI~/\&.gitconfig\fR file\&.
115.sp
116.if n \{\
117.RS 4
118.\}
119.nf
120[alias]
121 git udiff = upstream\-diff
122.fi
123.if n \{\
124.RE
125.\}
126.sp
127.SH "SEE ALSO"
128.sp
129\fBgit-rebase-update\fR(1)
130.SH "CHROMIUM DEPOT_TOOLS"
131.sp
iannucci@chromium.org21980022014-04-11 04:51:49 +0000132Part 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 +0000133.SH "NOTES"
134.IP " 1." 4
135here
136.RS 4
Quinten Yearsley442fb642016-12-15 15:38:27 -0800137\%https://chromium.googlesource.com/chromium/tools/depot_tools.git
iannucci@chromium.orgc050a5b2014-03-26 06:18:50 +0000138.RE