blob: 6c934660d7bf0b5822bf2a7e6f8eb68cecbfc501 [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 Hamanoedd2b0a2007-01-15 06:12:4527-<n>::
Junio C Hamano1a4e8412005-12-27 08:17:2328Limits the number of commits to show.
Junio C Hamanod2c978f2011-03-20 19:42:2229Note that this is a commit limiting option, see below.
Junio C Hamano1a4e8412005-12-27 08:17:2330
31<since>..<until>::
Junio C Hamano775a0f42006-12-31 01:19:1432Show only commits between the named two commits. When
33either <since> or <until> is omitted, it defaults to
34`HEAD`, i.e. the tip of the current branch.
Junio C Hamano2d47c622007-01-18 06:24:1035For a more complete list of ways to spell <since>
Junio C Hamanoc27b7332010-10-14 04:37:2836and <until>, see linkgit:gitrevisions[7].
Junio C Hamano78e3a782010-07-15 22:24:4537
38--follow::
39Continue listing the history of a file beyond renames
40(works only for a single file).
Junio C Hamano1a4e8412005-12-27 08:17:2341
Junio C Hamanocb39aea2010-05-09 07:24:4842--no-decorate::
43--decorate[=short|full|no]::
Junio C Hamanoc276ec72009-08-26 01:35:2244Print out the ref names of any commits that are shown. If 'short' is
45specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
46'refs/remotes/' will not be printed. If 'full' is specified, the
47full ref name (including prefix) will be printed. The default option
48is 'short'.
Junio C Hamanoee695f22007-06-21 00:35:3649
Junio C Hamano28363492008-11-14 08:26:3150--source::
51Print out the ref name given on the command line by which each
52commit was reached.
53
Junio C Hamanoee695f22007-06-21 00:35:3654--full-diff::
Junio C Hamano9e395072008-07-31 22:11:2155Without this flag, "git log -p <path>..." shows commits that
Junio C Hamanoee695f22007-06-21 00:35:3656touch the specified paths, and diffs about the same specified
57paths. With this, the full diff is shown for commits that touch
Junio C Hamano9e395072008-07-31 22:11:2158the specified paths; this means that "<path>..." limits only
Junio C Hamanoee695f22007-06-21 00:35:3659commits, and doesn't limit diff for those commits.
Junio C Hamanoe85e36f2010-08-10 05:30:1460+
61Note that this affects all diff-based output types, e.g. those
62produced by --stat etc.
Junio C Hamanoea5dae62007-05-10 23:25:0863
Junio C Hamano024b6c62007-08-14 09:43:0864--log-size::
65Before the log message print out its size in bytes. Intended
66mainly for porcelain tools consumption. If git is unable to
67produce a valid value size is set to zero.
68Note that only message is considered, if also a diff is shown
69its size is not included.
70
Junio C Hamanoa476efa2008-10-10 15:31:4271[\--] <path>...::
72Show only commits that affect any of the specified paths. To
73prevent confusion with options and branch names, paths may need
74to be prefixed with "\-- " to separate them from options or
75refnames.
Junio C Hamanoba7c8d82006-04-15 06:17:4276
Junio C Hamanob0e02952008-01-19 08:02:0077include::rev-list-options.txt[]
78
Junio C Hamano0430e3a2007-05-15 03:13:1779include::pretty-formats.txt[]
80
Junio C Hamanod2c978f2011-03-20 19:42:2281Common diff options
82-------------------
83
84:git-log: 1
85include::diff-options.txt[]
86
Junio C Hamano00b8b632007-12-07 09:50:4987include::diff-generate-patch.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:1788
Junio C Hamano1a4e8412005-12-27 08:17:2389Examples
90--------
Junio C Hamano16ebcd02011-08-05 00:05:4591`git log --no-merges`::
Junio C Hamano1a4e8412005-12-27 08:17:2392
93Show the whole commit history, but skip any merges
94
Junio C Hamano16ebcd02011-08-05 00:05:4595`git log v2.6.12.. include/scsi drivers/scsi`::
Junio C Hamano1a4e8412005-12-27 08:17:2396
97Show all commits since version 'v2.6.12' that changed any file
98in the include/scsi or drivers/scsi subdirectories
99
Junio C Hamano16ebcd02011-08-05 00:05:45100`git log --since="2 weeks ago" \-- gitk`::
Junio C Hamano1a4e8412005-12-27 08:17:23101
102Show the changes during the last two weeks to the file 'gitk'.
103The "--" is necessary to avoid confusion with the *branch* named
104'gitk'
105
Junio C Hamano16ebcd02011-08-05 00:05:45106`git log --name-status release..test`::
Junio C Hamanoba7c8d82006-04-15 06:17:42107
108Show the commits that are in the "test" branch but not yet
109in the "release" branch, along with the list of paths
110each commit modifies.
Junio C Hamano1a4e8412005-12-27 08:17:23111
Junio C Hamano16ebcd02011-08-05 00:05:45112`git log --follow builtin-rev-list.c`::
Junio C Hamano235d53f2007-07-13 00:25:15113
114Shows the commits that changed builtin-rev-list.c, including
115those commits that occurred before the file was given its
116present name.
117
Junio C Hamano16ebcd02011-08-05 00:05:45118`git log --branches --not --remotes=origin`::
Junio C Hamano57827fb2010-01-23 03:02:50119
120Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:07121any of remote-tracking branches for 'origin' (what you have that
Junio C Hamano57827fb2010-01-23 03:02:50122origin doesn't).
123
Junio C Hamano16ebcd02011-08-05 00:05:45124`git log master --not --remotes=*/master`::
Junio C Hamano57827fb2010-01-23 03:02:50125
126Shows all commits that are in local master but not in any remote
127repository master branches.
128
Junio C Hamano16ebcd02011-08-05 00:05:45129`git log -p -m --first-parent`::
Junio C Hamano31667362010-03-25 00:38:53130
131Shows the history including change diffs, but only from the
132"main branch" perspective, skipping commits that come from merged
133branches, and showing full diffs of changes introduced by the merges.
134This makes sense only when following a strict policy of merging all
135topic branches when staying on a single integration branch.
136
137
Junio C Hamano775a0f42006-12-31 01:19:14138Discussion
139----------
140
141include::i18n.txt[]
142
Junio C Hamanoa574a092010-06-13 19:57:10143Configuration
144-------------
145
146See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
147for settings related to diff generation.
148
149format.pretty::
150Default for the `--format` option. (See "PRETTY FORMATS" above.)
151Defaults to "medium".
152
153i18n.logOutputEncoding::
154Encoding to use when displaying logs. (See "Discussion", above.)
155Defaults to the value of `i18n.commitEncoding` if set, UTF-8
156otherwise.
157
158log.date::
159Default format for human-readable dates. (Compare the
160`--date` option.) Defaults to "default", which means to write
161dates like `Sat May 8 19:35:34 2010 -0500`.
162
163log.showroot::
164If `false`, 'git log' and related commands will not treat the
165initial commit as a big creation event. Any root commits in
166`git log -p` output would be shown without a diff attached.
167The default is `true`.
168
169mailmap.file::
170See linkgit:git-shortlog[1].
171
172notes.displayRef::
173Which refs, in addition to the default set by `core.notesRef`
174or 'GIT_NOTES_REF', to read notes from when showing commit
175messages with the 'log' family of commands. See
176linkgit:git-notes[1].
177+
178May be an unabbreviated ref name or a glob and may be specified
179multiple times. A warning will be issued for refs that do not exist,
180but a glob that does not match any refs is silently ignored.
181+
Junio C Hamano60033462011-05-03 00:48:43182This setting can be disabled by the `--no-notes` option,
Junio C Hamanoa574a092010-06-13 19:57:10183overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
Junio C Hamano60033462011-05-03 00:48:43184and overridden by the `--notes=<ref>` option.
Junio C Hamano775a0f42006-12-31 01:19:14185
Junio C Hamano1a4e8412005-12-27 08:17:23186GIT
187---
Junio C Hamanof7c042d2008-06-06 22:50:53188Part of the linkgit:git[1] suite