blob: a976534ab870a89a236ec7190f985e20f771e7f7 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-log(1)
2==========
3
4NAME
5----
6git-log - Show commit logs
7
8
9SYNOPSIS
10--------
Junio C Hamano15567bc2011-07-23 00:51:5911[verse]
Junio C Hamanof26c77e2013-04-27 00:06:0412'git log' [<options>] [<revision range>] [[\--] <path>...]
Junio C Hamano1a4e8412005-12-27 08:17:2313
14DESCRIPTION
15-----------
Junio C Hamanoba7c8d82006-04-15 06:17:4216Shows the commit logs.
Junio C Hamano1a4e8412005-12-27 08:17:2317
Junio C Hamano1aa40d22010-01-21 17:46:4318The command takes options applicable to the 'git rev-list'
Junio C Hamanoba7c8d82006-04-15 06:17:4219command to control what is shown and how, and options applicable to
Junio C Hamano1aa40d22010-01-21 17:46:4320the 'git diff-*' commands to control how the changes
Junio C Hamanoba7c8d82006-04-15 06:17:4221each commit introduces are shown.
22
Junio C Hamano1a4e8412005-12-27 08:17:2323
24OPTIONS
25-------
Junio C Hamanoa340aaa2006-11-23 02:47:3326
Junio C Hamano78e3a782010-07-15 22:24:4527--follow::
28Continue listing the history of a file beyond renames
29(works only for a single file).
Junio C Hamano1a4e8412005-12-27 08:17:2330
Junio C Hamanocb39aea2010-05-09 07:24:4831--no-decorate::
32--decorate[=short|full|no]::
Junio C Hamanoc276ec72009-08-26 01:35:2233Print out the ref names of any commits that are shown. If 'short' is
34specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
35'refs/remotes/' will not be printed. If 'full' is specified, the
36full ref name (including prefix) will be printed. The default option
37is 'short'.
Junio C Hamanoee695f22007-06-21 00:35:3638
Junio C Hamano28363492008-11-14 08:26:3139--source::
40Print out the ref name given on the command line by which each
41commit was reached.
42
Junio C Hamanoce836cc2013-01-21 02:01:5343--use-mailmap::
44Use mailmap file to map author and committer names and email
45to canonical real names and email addresses. See
46linkgit:git-shortlog[1].
47
Junio C Hamanoee695f22007-06-21 00:35:3648--full-diff::
Junio C Hamano9e395072008-07-31 22:11:2149Without this flag, "git log -p <path>..." shows commits that
Junio C Hamanoee695f22007-06-21 00:35:3650touch the specified paths, and diffs about the same specified
51paths. With this, the full diff is shown for commits that touch
Junio C Hamano9e395072008-07-31 22:11:2152the specified paths; this means that "<path>..." limits only
Junio C Hamanoee695f22007-06-21 00:35:3653commits, and doesn't limit diff for those commits.
Junio C Hamanoe85e36f2010-08-10 05:30:1454+
55Note that this affects all diff-based output types, e.g. those
56produced by --stat etc.
Junio C Hamanoea5dae62007-05-10 23:25:0857
Junio C Hamano024b6c62007-08-14 09:43:0858--log-size::
59Before the log message print out its size in bytes. Intended
Junio C Hamano076ffcc2013-02-06 05:13:2160mainly for porcelain tools consumption. If Git is unable to
Junio C Hamano024b6c62007-08-14 09:43:0861produce a valid value size is set to zero.
62Note that only message is considered, if also a diff is shown
63its size is not included.
64
Junio C Hamanof26c77e2013-04-27 00:06:0465<revision range>::
66Show only commits in the specified revision range. When no
67<revision range> is specified, it defaults to `HEAD` (i.e. the
68whole history leading to the current commit). `origin..HEAD`
69specifies all the commits reachable from the current commit
70(i.e. `HEAD`), but not from `origin`. For a complete list of
71ways to spell <revision range>, see the "Specifying Ranges"
72section of linkgit:gitrevisions[7].
73
Junio C Hamanoa476efa2008-10-10 15:31:4274[\--] <path>...::
Junio C Hamano5723afa2011-08-31 00:49:2375Show only commits that are enough to explain how the files
76that match the specified paths came to be. See "History
77Simplification" below for details and other simplification
78modes.
79+
Junio C Hamanof26c77e2013-04-27 00:06:0480Paths may need to be prefixed with "\-- " to separate them from
81options or the revision range, when confusion arises.
Junio C Hamanoba7c8d82006-04-15 06:17:4282
Junio C Hamanob0e02952008-01-19 08:02:0083include::rev-list-options.txt[]
84
Junio C Hamano0430e3a2007-05-15 03:13:1785include::pretty-formats.txt[]
86
Junio C Hamanod2c978f2011-03-20 19:42:2287Common diff options
88-------------------
89
90:git-log: 1
91include::diff-options.txt[]
92
Junio C Hamano00b8b632007-12-07 09:50:4993include::diff-generate-patch.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:1794
Junio C Hamano1a4e8412005-12-27 08:17:2395Examples
96--------
Junio C Hamano16ebcd02011-08-05 00:05:4597`git log --no-merges`::
Junio C Hamano1a4e8412005-12-27 08:17:2398
99Show the whole commit history, but skip any merges
100
Junio C Hamano16ebcd02011-08-05 00:05:45101`git log v2.6.12.. include/scsi drivers/scsi`::
Junio C Hamano1a4e8412005-12-27 08:17:23102
103Show all commits since version 'v2.6.12' that changed any file
104in the include/scsi or drivers/scsi subdirectories
105
Junio C Hamanob76a6862012-05-02 22:02:46106`git log --since="2 weeks ago" -- gitk`::
Junio C Hamano1a4e8412005-12-27 08:17:23107
108Show the changes during the last two weeks to the file 'gitk'.
109The "--" is necessary to avoid confusion with the *branch* named
110'gitk'
111
Junio C Hamano16ebcd02011-08-05 00:05:45112`git log --name-status release..test`::
Junio C Hamanoba7c8d82006-04-15 06:17:42113
114Show the commits that are in the "test" branch but not yet
115in the "release" branch, along with the list of paths
116each commit modifies.
Junio C Hamano1a4e8412005-12-27 08:17:23117
Junio C Hamano16ebcd02011-08-05 00:05:45118`git log --follow builtin-rev-list.c`::
Junio C Hamano235d53f2007-07-13 00:25:15119
120Shows the commits that changed builtin-rev-list.c, including
121those commits that occurred before the file was given its
122present name.
123
Junio C Hamano16ebcd02011-08-05 00:05:45124`git log --branches --not --remotes=origin`::
Junio C Hamano57827fb2010-01-23 03:02:50125
126Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:07127any of remote-tracking branches for 'origin' (what you have that
Junio C Hamano57827fb2010-01-23 03:02:50128origin doesn't).
129
Junio C Hamano16ebcd02011-08-05 00:05:45130`git log master --not --remotes=*/master`::
Junio C Hamano57827fb2010-01-23 03:02:50131
132Shows all commits that are in local master but not in any remote
133repository master branches.
134
Junio C Hamano16ebcd02011-08-05 00:05:45135`git log -p -m --first-parent`::
Junio C Hamano31667362010-03-25 00:38:53136
137Shows the history including change diffs, but only from the
138"main branch" perspective, skipping commits that come from merged
139branches, and showing full diffs of changes introduced by the merges.
140This makes sense only when following a strict policy of merging all
141topic branches when staying on a single integration branch.
142
Junio C Hamano693e7092012-09-12 22:56:53143`git log -3`::
144Limits the number of commits to show to 3.
Junio C Hamano31667362010-03-25 00:38:53145
Junio C Hamano775a0f42006-12-31 01:19:14146Discussion
147----------
148
149include::i18n.txt[]
150
Junio C Hamanoa574a092010-06-13 19:57:10151Configuration
152-------------
153
154See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
155for settings related to diff generation.
156
157format.pretty::
158Default for the `--format` option. (See "PRETTY FORMATS" above.)
159Defaults to "medium".
160
161i18n.logOutputEncoding::
162Encoding to use when displaying logs. (See "Discussion", above.)
163Defaults to the value of `i18n.commitEncoding` if set, UTF-8
164otherwise.
165
166log.date::
167Default format for human-readable dates. (Compare the
168`--date` option.) Defaults to "default", which means to write
169dates like `Sat May 8 19:35:34 2010 -0500`.
170
171log.showroot::
172If `false`, 'git log' and related commands will not treat the
173initial commit as a big creation event. Any root commits in
174`git log -p` output would be shown without a diff attached.
175The default is `true`.
176
Junio C Hamanoabad6da2013-01-06 09:06:32177mailmap.*::
Junio C Hamanoa574a092010-06-13 19:57:10178See linkgit:git-shortlog[1].
179
180notes.displayRef::
181Which refs, in addition to the default set by `core.notesRef`
182or 'GIT_NOTES_REF', to read notes from when showing commit
183messages with the 'log' family of commands. See
184linkgit:git-notes[1].
185+
186May be an unabbreviated ref name or a glob and may be specified
187multiple times. A warning will be issued for refs that do not exist,
188but a glob that does not match any refs is silently ignored.
189+
Junio C Hamano60033462011-05-03 00:48:43190This setting can be disabled by the `--no-notes` option,
Junio C Hamanoa574a092010-06-13 19:57:10191overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
Junio C Hamano60033462011-05-03 00:48:43192and overridden by the `--notes=<ref>` option.
Junio C Hamano775a0f42006-12-31 01:19:14193
Junio C Hamano1a4e8412005-12-27 08:17:23194GIT
195---
Junio C Hamanof7c042d2008-06-06 22:50:53196Part of the linkgit:git[1] suite