blob: 22c0d6e4b1074b71468ac1c9b16d7eeb0434e225 [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 Hamanoce836cc2013-01-21 02:01:5350--use-mailmap::
51Use mailmap file to map author and committer names and email
52to canonical real names and email addresses. See
53linkgit:git-shortlog[1].
54
Junio C Hamanoee695f22007-06-21 00:35:3655--full-diff::
Junio C Hamano9e395072008-07-31 22:11:2156Without this flag, "git log -p <path>..." shows commits that
Junio C Hamanoee695f22007-06-21 00:35:3657touch the specified paths, and diffs about the same specified
58paths. With this, the full diff is shown for commits that touch
Junio C Hamano9e395072008-07-31 22:11:2159the specified paths; this means that "<path>..." limits only
Junio C Hamanoee695f22007-06-21 00:35:3660commits, and doesn't limit diff for those commits.
Junio C Hamanoe85e36f2010-08-10 05:30:1461+
62Note that this affects all diff-based output types, e.g. those
63produced by --stat etc.
Junio C Hamanoea5dae62007-05-10 23:25:0864
Junio C Hamano024b6c62007-08-14 09:43:0865--log-size::
66Before the log message print out its size in bytes. Intended
67mainly for porcelain tools consumption. If git is unable to
68produce a valid value size is set to zero.
69Note that only message is considered, if also a diff is shown
70its size is not included.
71
Junio C Hamanoa476efa2008-10-10 15:31:4272[\--] <path>...::
Junio C Hamano5723afa2011-08-31 00:49:2373Show only commits that are enough to explain how the files
74that match the specified paths came to be. See "History
75Simplification" below for details and other simplification
76modes.
77+
78To prevent confusion with options and branch names, paths may need to
79be prefixed with "\-- " to separate them from options or refnames.
Junio C Hamanoba7c8d82006-04-15 06:17:4280
Junio C Hamanob0e02952008-01-19 08:02:0081include::rev-list-options.txt[]
82
Junio C Hamano0430e3a2007-05-15 03:13:1783include::pretty-formats.txt[]
84
Junio C Hamanod2c978f2011-03-20 19:42:2285Common diff options
86-------------------
87
88:git-log: 1
89include::diff-options.txt[]
90
Junio C Hamano00b8b632007-12-07 09:50:4991include::diff-generate-patch.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:1792
Junio C Hamano1a4e8412005-12-27 08:17:2393Examples
94--------
Junio C Hamano16ebcd02011-08-05 00:05:4595`git log --no-merges`::
Junio C Hamano1a4e8412005-12-27 08:17:2396
97Show the whole commit history, but skip any merges
98
Junio C Hamano16ebcd02011-08-05 00:05:4599`git log v2.6.12.. include/scsi drivers/scsi`::
Junio C Hamano1a4e8412005-12-27 08:17:23100
101Show all commits since version 'v2.6.12' that changed any file
102in the include/scsi or drivers/scsi subdirectories
103
Junio C Hamanob76a6862012-05-02 22:02:46104`git log --since="2 weeks ago" -- gitk`::
Junio C Hamano1a4e8412005-12-27 08:17:23105
106Show the changes during the last two weeks to the file 'gitk'.
107The "--" is necessary to avoid confusion with the *branch* named
108'gitk'
109
Junio C Hamano16ebcd02011-08-05 00:05:45110`git log --name-status release..test`::
Junio C Hamanoba7c8d82006-04-15 06:17:42111
112Show the commits that are in the "test" branch but not yet
113in the "release" branch, along with the list of paths
114each commit modifies.
Junio C Hamano1a4e8412005-12-27 08:17:23115
Junio C Hamano16ebcd02011-08-05 00:05:45116`git log --follow builtin-rev-list.c`::
Junio C Hamano235d53f2007-07-13 00:25:15117
118Shows the commits that changed builtin-rev-list.c, including
119those commits that occurred before the file was given its
120present name.
121
Junio C Hamano16ebcd02011-08-05 00:05:45122`git log --branches --not --remotes=origin`::
Junio C Hamano57827fb2010-01-23 03:02:50123
124Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:07125any of remote-tracking branches for 'origin' (what you have that
Junio C Hamano57827fb2010-01-23 03:02:50126origin doesn't).
127
Junio C Hamano16ebcd02011-08-05 00:05:45128`git log master --not --remotes=*/master`::
Junio C Hamano57827fb2010-01-23 03:02:50129
130Shows all commits that are in local master but not in any remote
131repository master branches.
132
Junio C Hamano16ebcd02011-08-05 00:05:45133`git log -p -m --first-parent`::
Junio C Hamano31667362010-03-25 00:38:53134
135Shows the history including change diffs, but only from the
136"main branch" perspective, skipping commits that come from merged
137branches, and showing full diffs of changes introduced by the merges.
138This makes sense only when following a strict policy of merging all
139topic branches when staying on a single integration branch.
140
Junio C Hamano693e7092012-09-12 22:56:53141`git log -3`::
142Limits the number of commits to show to 3.
Junio C Hamano31667362010-03-25 00:38:53143
Junio C Hamano775a0f42006-12-31 01:19:14144Discussion
145----------
146
147include::i18n.txt[]
148
Junio C Hamanoa574a092010-06-13 19:57:10149Configuration
150-------------
151
152See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
153for settings related to diff generation.
154
155format.pretty::
156Default for the `--format` option. (See "PRETTY FORMATS" above.)
157Defaults to "medium".
158
159i18n.logOutputEncoding::
160Encoding to use when displaying logs. (See "Discussion", above.)
161Defaults to the value of `i18n.commitEncoding` if set, UTF-8
162otherwise.
163
164log.date::
165Default format for human-readable dates. (Compare the
166`--date` option.) Defaults to "default", which means to write
167dates like `Sat May 8 19:35:34 2010 -0500`.
168
169log.showroot::
170If `false`, 'git log' and related commands will not treat the
171initial commit as a big creation event. Any root commits in
172`git log -p` output would be shown without a diff attached.
173The default is `true`.
174
Junio C Hamanoabad6da2013-01-06 09:06:32175mailmap.*::
Junio C Hamanoa574a092010-06-13 19:57:10176See linkgit:git-shortlog[1].
177
178notes.displayRef::
179Which refs, in addition to the default set by `core.notesRef`
180or 'GIT_NOTES_REF', to read notes from when showing commit
181messages with the 'log' family of commands. See
182linkgit:git-notes[1].
183+
184May be an unabbreviated ref name or a glob and may be specified
185multiple times. A warning will be issued for refs that do not exist,
186but a glob that does not match any refs is silently ignored.
187+
Junio C Hamano60033462011-05-03 00:48:43188This setting can be disabled by the `--no-notes` option,
Junio C Hamanoa574a092010-06-13 19:57:10189overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
Junio C Hamano60033462011-05-03 00:48:43190and overridden by the `--notes=<ref>` option.
Junio C Hamano775a0f42006-12-31 01:19:14191
Junio C Hamano1a4e8412005-12-27 08:17:23192GIT
193---
Junio C Hamanof7c042d2008-06-06 22:50:53194Part of the linkgit:git[1] suite