blob: 1f906208f9514180fe9f20293ab28ce8180b5357 [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>...::
Junio C Hamano5723afa2011-08-31 00:49:2372Show only commits that are enough to explain how the files
73that match the specified paths came to be. See "History
74Simplification" below for details and other simplification
75modes.
76+
77To prevent confusion with options and branch names, paths may need to
78be prefixed with "\-- " to separate them from options or refnames.
Junio C Hamanoba7c8d82006-04-15 06:17:4279
Junio C Hamanob0e02952008-01-19 08:02:0080include::rev-list-options.txt[]
81
Junio C Hamano0430e3a2007-05-15 03:13:1782include::pretty-formats.txt[]
83
Junio C Hamanod2c978f2011-03-20 19:42:2284Common diff options
85-------------------
86
87:git-log: 1
88include::diff-options.txt[]
89
Junio C Hamano00b8b632007-12-07 09:50:4990include::diff-generate-patch.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:1791
Junio C Hamano1a4e8412005-12-27 08:17:2392Examples
93--------
Junio C Hamano16ebcd02011-08-05 00:05:4594`git log --no-merges`::
Junio C Hamano1a4e8412005-12-27 08:17:2395
96Show the whole commit history, but skip any merges
97
Junio C Hamano16ebcd02011-08-05 00:05:4598`git log v2.6.12.. include/scsi drivers/scsi`::
Junio C Hamano1a4e8412005-12-27 08:17:2399
100Show all commits since version 'v2.6.12' that changed any file
101in the include/scsi or drivers/scsi subdirectories
102
Junio C Hamanob76a6862012-05-02 22:02:46103`git log --since="2 weeks ago" -- gitk`::
Junio C Hamano1a4e8412005-12-27 08:17:23104
105Show the changes during the last two weeks to the file 'gitk'.
106The "--" is necessary to avoid confusion with the *branch* named
107'gitk'
108
Junio C Hamano16ebcd02011-08-05 00:05:45109`git log --name-status release..test`::
Junio C Hamanoba7c8d82006-04-15 06:17:42110
111Show the commits that are in the "test" branch but not yet
112in the "release" branch, along with the list of paths
113each commit modifies.
Junio C Hamano1a4e8412005-12-27 08:17:23114
Junio C Hamano16ebcd02011-08-05 00:05:45115`git log --follow builtin-rev-list.c`::
Junio C Hamano235d53f2007-07-13 00:25:15116
117Shows the commits that changed builtin-rev-list.c, including
118those commits that occurred before the file was given its
119present name.
120
Junio C Hamano16ebcd02011-08-05 00:05:45121`git log --branches --not --remotes=origin`::
Junio C Hamano57827fb2010-01-23 03:02:50122
123Shows all commits that are in any of local branches but not in
Junio C Hamano97bcb482010-11-25 03:16:07124any of remote-tracking branches for 'origin' (what you have that
Junio C Hamano57827fb2010-01-23 03:02:50125origin doesn't).
126
Junio C Hamano16ebcd02011-08-05 00:05:45127`git log master --not --remotes=*/master`::
Junio C Hamano57827fb2010-01-23 03:02:50128
129Shows all commits that are in local master but not in any remote
130repository master branches.
131
Junio C Hamano16ebcd02011-08-05 00:05:45132`git log -p -m --first-parent`::
Junio C Hamano31667362010-03-25 00:38:53133
134Shows the history including change diffs, but only from the
135"main branch" perspective, skipping commits that come from merged
136branches, and showing full diffs of changes introduced by the merges.
137This makes sense only when following a strict policy of merging all
138topic branches when staying on a single integration branch.
139
140
Junio C Hamano775a0f42006-12-31 01:19:14141Discussion
142----------
143
144include::i18n.txt[]
145
Junio C Hamanoa574a092010-06-13 19:57:10146Configuration
147-------------
148
149See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
150for settings related to diff generation.
151
152format.pretty::
153Default for the `--format` option. (See "PRETTY FORMATS" above.)
154Defaults to "medium".
155
156i18n.logOutputEncoding::
157Encoding to use when displaying logs. (See "Discussion", above.)
158Defaults to the value of `i18n.commitEncoding` if set, UTF-8
159otherwise.
160
161log.date::
162Default format for human-readable dates. (Compare the
163`--date` option.) Defaults to "default", which means to write
164dates like `Sat May 8 19:35:34 2010 -0500`.
165
166log.showroot::
167If `false`, 'git log' and related commands will not treat the
168initial commit as a big creation event. Any root commits in
169`git log -p` output would be shown without a diff attached.
170The default is `true`.
171
172mailmap.file::
173See linkgit:git-shortlog[1].
174
175notes.displayRef::
176Which refs, in addition to the default set by `core.notesRef`
177or 'GIT_NOTES_REF', to read notes from when showing commit
178messages with the 'log' family of commands. See
179linkgit:git-notes[1].
180+
181May be an unabbreviated ref name or a glob and may be specified
182multiple times. A warning will be issued for refs that do not exist,
183but a glob that does not match any refs is silently ignored.
184+
Junio C Hamano60033462011-05-03 00:48:43185This setting can be disabled by the `--no-notes` option,
Junio C Hamanoa574a092010-06-13 19:57:10186overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
Junio C Hamano60033462011-05-03 00:48:43187and overridden by the `--notes=<ref>` option.
Junio C Hamano775a0f42006-12-31 01:19:14188
Junio C Hamano1a4e8412005-12-27 08:17:23189GIT
190---
Junio C Hamanof7c042d2008-06-06 22:50:53191Part of the linkgit:git[1] suite