blob: fb184ba1863845797a5f296581ec74a1b31bef1a [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 Hamanoa476efa2008-10-10 15:31:4211'git log' [<options>] [<since>..<until>] [[\--] <path>...]
Junio C Hamano1a4e8412005-12-27 08:17:2312
13DESCRIPTION
14-----------
Junio C Hamanoba7c8d82006-04-15 06:17:4215Shows the commit logs.
Junio C Hamano1a4e8412005-12-27 08:17:2316
Junio C Hamano1aa40d22010-01-21 17:46:4317The command takes options applicable to the 'git rev-list'
Junio C Hamanoba7c8d82006-04-15 06:17:4218command to control what is shown and how, and options applicable to
Junio C Hamano1aa40d22010-01-21 17:46:4319the 'git diff-*' commands to control how the changes
Junio C Hamanoba7c8d82006-04-15 06:17:4220each commit introduces are shown.
21
Junio C Hamano1a4e8412005-12-27 08:17:2322
23OPTIONS
24-------
Junio C Hamanoa340aaa2006-11-23 02:47:3325
Junio C Hamano00b8b632007-12-07 09:50:4926:git-log: 1
27include::diff-options.txt[]
28
Junio C Hamanoedd2b0a2007-01-15 06:12:4529-<n>::
Junio C Hamano1a4e8412005-12-27 08:17:2330Limits the number of commits to show.
31
32<since>..<until>::
Junio C Hamano775a0f42006-12-31 01:19:1433Show only commits between the named two commits. When
34either <since> or <until> is omitted, it defaults to
35`HEAD`, i.e. the tip of the current branch.
Junio C Hamano2d47c622007-01-18 06:24:1036For a more complete list of ways to spell <since>
37and <until>, see "SPECIFYING REVISIONS" section in
Junio C Hamano35738e82008-01-07 07:55:4638linkgit:git-rev-parse[1].
Junio C Hamano1a4e8412005-12-27 08:17:2339
Junio C Hamanoc276ec72009-08-26 01:35:2240--decorate[=short|full]::
41Print out the ref names of any commits that are shown. If 'short' is
42specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
43'refs/remotes/' will not be printed. If 'full' is specified, the
44full ref name (including prefix) will be printed. The default option
45is 'short'.
Junio C Hamanoee695f22007-06-21 00:35:3646
Junio C Hamano28363492008-11-14 08:26:3147--source::
48Print out the ref name given on the command line by which each
49commit was reached.
50
Junio C Hamanoee695f22007-06-21 00:35:3651--full-diff::
Junio C Hamano9e395072008-07-31 22:11:2152Without this flag, "git log -p <path>..." shows commits that
Junio C Hamanoee695f22007-06-21 00:35:3653touch the specified paths, and diffs about the same specified
54paths. With this, the full diff is shown for commits that touch
Junio C Hamano9e395072008-07-31 22:11:2155the specified paths; this means that "<path>..." limits only
Junio C Hamanoee695f22007-06-21 00:35:3656commits, and doesn't limit diff for those commits.
Junio C Hamanoea5dae62007-05-10 23:25:0857
Junio C Hamano235d53f2007-07-13 00:25:1558--follow::
59Continue listing the history of a file beyond renames.
60
Junio C Hamano024b6c62007-08-14 09:43:0861--log-size::
62Before the log message print out its size in bytes. Intended
63mainly for porcelain tools consumption. If git is unable to
64produce a valid value size is set to zero.
65Note that only message is considered, if also a diff is shown
66its size is not included.
67
Junio C Hamanoa476efa2008-10-10 15:31:4268[\--] <path>...::
69Show only commits that affect any of the specified paths. To
70prevent confusion with options and branch names, paths may need
71to be prefixed with "\-- " to separate them from options or
72refnames.
Junio C Hamanoba7c8d82006-04-15 06:17:4273
Junio C Hamano1a4e8412005-12-27 08:17:2374
Junio C Hamanob0e02952008-01-19 08:02:0075include::rev-list-options.txt[]
76
Junio C Hamano0430e3a2007-05-15 03:13:1777include::pretty-formats.txt[]
78
Junio C Hamano00b8b632007-12-07 09:50:4979include::diff-generate-patch.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:1780
Junio C Hamano1a4e8412005-12-27 08:17:2381Examples
82--------
83git log --no-merges::
84
85Show the whole commit history, but skip any merges
86
87git log v2.6.12.. include/scsi drivers/scsi::
88
89Show all commits since version 'v2.6.12' that changed any file
90in the include/scsi or drivers/scsi subdirectories
91
Junio C Hamano1bb569e2006-05-05 23:14:2592git log --since="2 weeks ago" \-- gitk::
Junio C Hamano1a4e8412005-12-27 08:17:2393
94Show the changes during the last two weeks to the file 'gitk'.
95The "--" is necessary to avoid confusion with the *branch* named
96'gitk'
97
Junio C Hamano7d9e9bd2007-08-29 07:31:4798git log --name-status release..test::
Junio C Hamanoba7c8d82006-04-15 06:17:4299
100Show the commits that are in the "test" branch but not yet
101in the "release" branch, along with the list of paths
102each commit modifies.
Junio C Hamano1a4e8412005-12-27 08:17:23103
Junio C Hamano235d53f2007-07-13 00:25:15104git log --follow builtin-rev-list.c::
105
106Shows the commits that changed builtin-rev-list.c, including
107those commits that occurred before the file was given its
108present name.
109
Junio C Hamano57827fb2010-01-23 03:02:50110git log --branches --not --remotes=origin::
111
112Shows all commits that are in any of local branches but not in
113any of remote tracking branches for 'origin' (what you have that
114origin doesn't).
115
116git log master --not --remotes=*/master::
117
118Shows all commits that are in local master but not in any remote
119repository master branches.
120
Junio C Hamano31667362010-03-25 00:38:53121git log -p -m --first-parent::
122
123Shows the history including change diffs, but only from the
124"main branch" perspective, skipping commits that come from merged
125branches, and showing full diffs of changes introduced by the merges.
126This makes sense only when following a strict policy of merging all
127topic branches when staying on a single integration branch.
128
129
Junio C Hamano775a0f42006-12-31 01:19:14130Discussion
131----------
132
133include::i18n.txt[]
134
135
Junio C Hamano1a4e8412005-12-27 08:17:23136Author
137------
138Written by Linus Torvalds <torvalds@osdl.org>
139
140Documentation
141--------------
142Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
143
144GIT
145---
Junio C Hamanof7c042d2008-06-06 22:50:53146Part of the linkgit:git[1] suite