blob: 585dac40baabbee291f43a6e7c59c36340286e43 [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 Hamanoa476efa2008-10-10 15:31:4212'git log' [<options>] [<since>..<until>] [[\--] <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 Hamano1a4e8412005-12-27 08:17:2327<since>..<until>::
Junio C Hamano775a0f42006-12-31 01:19:1428Show only commits between the named two commits. When
29either <since> or <until> is omitted, it defaults to
30`HEAD`, i.e. the tip of the current branch.
Junio C Hamano2d47c622007-01-18 06:24:1031For a more complete list of ways to spell <since>
Junio C Hamanoc27b7332010-10-14 04:37:2832and <until>, see linkgit:gitrevisions[7].
Junio C Hamano78e3a782010-07-15 22:24:4533
34--follow::
35Continue listing the history of a file beyond renames
36(works only for a single file).
Junio C Hamano1a4e8412005-12-27 08:17:2337
Junio C Hamanocb39aea2010-05-09 07:24:4838--no-decorate::
39--decorate[=short|full|no]::
Junio C Hamanoc276ec72009-08-26 01:35:2240Print out the ref names of any commits that are shown. If 'short' is
41specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
42'refs/remotes/' will not be printed. If 'full' is specified, the
43full ref name (including prefix) will be printed. The default option
44is 'short'.
Junio C Hamanoee695f22007-06-21 00:35:3645
Junio C Hamano28363492008-11-14 08:26:3146--source::
47Print out the ref name given on the command line by which each
48commit was reached.
49
Junio C Hamanoee695f22007-06-21 00:35:3650--full-diff::
Junio C Hamano9e395072008-07-31 22:11:2151Without this flag, "git log -p <path>..." shows commits that
Junio C Hamanoee695f22007-06-21 00:35:3652touch the specified paths, and diffs about the same specified
53paths. With this, the full diff is shown for commits that touch
Junio C Hamano9e395072008-07-31 22:11:2154the specified paths; this means that "<path>..." limits only
Junio C Hamanoee695f22007-06-21 00:35:3655commits, and doesn't limit diff for those commits.
Junio C Hamanoe85e36f2010-08-10 05:30:1456+
57Note that this affects all diff-based output types, e.g. those
58produced by --stat etc.
Junio C Hamanoea5dae62007-05-10 23:25:0859
Junio C Hamano024b6c62007-08-14 09:43:0860--log-size::
61Before the log message print out its size in bytes. Intended
62mainly for porcelain tools consumption. If git is unable to
63produce a valid value size is set to zero.
64Note that only message is considered, if also a diff is shown
65its size is not included.
66
Junio C Hamanoa476efa2008-10-10 15:31:4267[\--] <path>...::
Junio C Hamano5723afa2011-08-31 00:49:2368Show only commits that are enough to explain how the files
69that match the specified paths came to be. See "History
70Simplification" below for details and other simplification
71modes.
72+
73To prevent confusion with options and branch names, paths may need to
74be prefixed with "\-- " to separate them from options or refnames.
Junio C Hamanoba7c8d82006-04-15 06:17:4275
Junio C Hamanob0e02952008-01-19 08:02:0076include::rev-list-options.txt[]
77
Junio C Hamano0430e3a2007-05-15 03:13:1778include::pretty-formats.txt[]
79
Junio C Hamanod2c978f2011-03-20 19:42:2280Common diff options
81-------------------
82
83:git-log: 1
84include::diff-options.txt[]
85
Junio C Hamano00b8b632007-12-07 09:50:4986include::diff-generate-patch.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:1787
Junio C Hamano1a4e8412005-12-27 08:17:2388Examples
89--------
Junio C Hamano16ebcd02011-08-05 00:05:4590`git log --no-merges`::
Junio C Hamano1a4e8412005-12-27 08:17:2391
92Show the whole commit history, but skip any merges
93
Junio C Hamano16ebcd02011-08-05 00:05:4594`git log v2.6.12.. include/scsi drivers/scsi`::
Junio C Hamano1a4e8412005-12-27 08:17:2395
96Show all commits since version 'v2.6.12' that changed any file
97in the include/scsi or drivers/scsi subdirectories
98
Junio C Hamanob76a6862012-05-02 22:02:4699`git log --since="2 weeks ago" -- gitk`::
Junio C Hamano1a4e8412005-12-27 08:17:23100
101Show the changes during the last two weeks to the file 'gitk'.
102The "--" is necessary to avoid confusion with the *branch* named
103'gitk'
104
Junio C Hamano16ebcd02011-08-05 00:05:45105`git log --name-status release..test`::
Junio C Hamanoba7c8d82006-04-15 06:17:42106
107Show the commits that are in the "test" branch but not yet
108in the "release" branch, along with the list of paths
109each commit modifies.
Junio C Hamano1a4e8412005-12-27 08:17:23110
Junio C Hamano16ebcd02011-08-05 00:05:45111`git log --follow builtin-rev-list.c`::
Junio C Hamano235d53f2007-07-13 00:25:15112
113Shows the commits that changed builtin-rev-list.c, including
114those commits that occurred before the file was given its
115present name.
116
Junio C Hamano16ebcd02011-08-05 00:05:45117`git log --branches --not --remotes=origin`::
Junio C Hamano57827fb2010-01-23 03:02:50118
119Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:07120any of remote-tracking branches for 'origin' (what you have that
Junio C Hamano57827fb2010-01-23 03:02:50121origin doesn't).
122
Junio C Hamano16ebcd02011-08-05 00:05:45123`git log master --not --remotes=*/master`::
Junio C Hamano57827fb2010-01-23 03:02:50124
125Shows all commits that are in local master but not in any remote
126repository master branches.
127
Junio C Hamano16ebcd02011-08-05 00:05:45128`git log -p -m --first-parent`::
Junio C Hamano31667362010-03-25 00:38:53129
130Shows the history including change diffs, but only from the
131"main branch" perspective, skipping commits that come from merged
132branches, and showing full diffs of changes introduced by the merges.
133This makes sense only when following a strict policy of merging all
134topic branches when staying on a single integration branch.
135
Junio C Hamano693e7092012-09-12 22:56:53136`git log -3`::
137Limits the number of commits to show to 3.
Junio C Hamano31667362010-03-25 00:38:53138
Junio C Hamano775a0f42006-12-31 01:19:14139Discussion
140----------
141
142include::i18n.txt[]
143
Junio C Hamanoa574a092010-06-13 19:57:10144Configuration
145-------------
146
147See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
148for settings related to diff generation.
149
150format.pretty::
151Default for the `--format` option. (See "PRETTY FORMATS" above.)
152Defaults to "medium".
153
154i18n.logOutputEncoding::
155Encoding to use when displaying logs. (See "Discussion", above.)
156Defaults to the value of `i18n.commitEncoding` if set, UTF-8
157otherwise.
158
159log.date::
160Default format for human-readable dates. (Compare the
161`--date` option.) Defaults to "default", which means to write
162dates like `Sat May 8 19:35:34 2010 -0500`.
163
164log.showroot::
165If `false`, 'git log' and related commands will not treat the
166initial commit as a big creation event. Any root commits in
167`git log -p` output would be shown without a diff attached.
168The default is `true`.
169
170mailmap.file::
171See linkgit:git-shortlog[1].
172
173notes.displayRef::
174Which refs, in addition to the default set by `core.notesRef`
175or 'GIT_NOTES_REF', to read notes from when showing commit
176messages with the 'log' family of commands. See
177linkgit:git-notes[1].
178+
179May be an unabbreviated ref name or a glob and may be specified
180multiple times. A warning will be issued for refs that do not exist,
181but a glob that does not match any refs is silently ignored.
182+
Junio C Hamano60033462011-05-03 00:48:43183This setting can be disabled by the `--no-notes` option,
Junio C Hamanoa574a092010-06-13 19:57:10184overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
Junio C Hamano60033462011-05-03 00:48:43185and overridden by the `--notes=<ref>` option.
Junio C Hamano775a0f42006-12-31 01:19:14186
Junio C Hamano1a4e8412005-12-27 08:17:23187GIT
188---
Junio C Hamanof7c042d2008-06-06 22:50:53189Part of the linkgit:git[1] suite