Start preparing for 1.7.10.1
[git/git.git] / Documentation / git-log.txt
CommitLineData
215a7ad1
JH
1git-log(1)
2==========
3f971fc4
JH
3
4NAME
5----
215a7ad1 6git-log - Show commit logs
3f971fc4
JH
7
8
9SYNOPSIS
10--------
7791a1d9 11[verse]
b1524ee0 12'git log' [<options>] [<since>..<until>] [[\--] <path>...]
3f971fc4
JH
13
14DESCRIPTION
15-----------
e51c3b50
JH
16Shows the commit logs.
17
0b444cdb 18The command takes options applicable to the 'git rev-list'
e51c3b50 19command to control what is shown and how, and options applicable to
0b444cdb 20the 'git diff-*' commands to control how the changes
e51c3b50
JH
21each commit introduces are shown.
22
3f971fc4
JH
23
24OPTIONS
25-------
5d1faf87 26
adb7ba6b 27-<n>::
3f971fc4 28 Limits the number of commits to show.
190767f6 29 Note that this is a commit limiting option, see below.
3f971fc4
JH
30
31<since>..<until>::
99e09cce
JH
32 Show only commits between the named two commits. When
33 either <since> or <until> is omitted, it defaults to
34 `HEAD`, i.e. the tip of the current branch.
41a5564e 35 For a more complete list of ways to spell <since>
9d83e382 36 and <until>, see linkgit:gitrevisions[7].
3f971fc4 37
4ded6916
EB
38--follow::
39 Continue listing the history of a file beyond renames
40 (works only for a single file).
41
8a3d203b
JH
42--no-decorate::
43--decorate[=short|full|no]::
33e7018c
LH
44 Print out the ref names of any commits that are shown. If 'short' is
45 specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
46 'refs/remotes/' will not be printed. If 'full' is specified, the
47 full ref name (including prefix) will be printed. The default option
48 is 'short'.
56822cc9 49
30c4d7a7
NS
50--source::
51 Print out the ref name given on the command line by which each
52 commit was reached.
53
2e88c266 54--full-diff::
f448e24e 55 Without this flag, "git log -p <path>..." shows commits that
2e88c266
JN
56 touch the specified paths, and diffs about the same specified
57 paths. With this, the full diff is shown for commits that touch
f448e24e 58 the specified paths; this means that "<path>..." limits only
2e88c266 59 commits, and doesn't limit diff for those commits.
b1c7946d
MG
60+
61Note that this affects all diff-based output types, e.g. those
62produced by --stat etc.
2e88c266 63
9fa3465d
MC
64--log-size::
65 Before the log message print out its size in bytes. Intended
66 mainly for porcelain tools consumption. If git is unable to
67 produce a valid value size is set to zero.
68 Note that only message is considered, if also a diff is shown
69 its size is not included.
70
b1524ee0 71[\--] <path>...::
b15b5b10
TR
72 Show only commits that are enough to explain how the files
73 that match the specified paths came to be. See "History
74 Simplification" below for details and other simplification
75 modes.
76+
77To prevent confusion with options and branch names, paths may need to
78be prefixed with "\-- " to separate them from options or refnames.
e51c3b50 79
f98fd436
MG
80include::rev-list-options.txt[]
81
82include::pretty-formats.txt[]
83
4ded6916 84Common diff options
f98fd436 85-------------------
4ded6916
EB
86
87:git-log: 1
88include::diff-options.txt[]
331b51d2 89
272bd3cf 90include::diff-generate-patch.txt[]
331b51d2 91
bd663611
LT
92Examples
93--------
5d2fc913 94`git log --no-merges`::
bd663611
LT
95
96 Show the whole commit history, but skip any merges
97
5d2fc913 98`git log v2.6.12.. include/scsi drivers/scsi`::
bd663611
LT
99
100 Show all commits since version 'v2.6.12' that changed any file
101 in the include/scsi or drivers/scsi subdirectories
102
5d2fc913 103`git log --since="2 weeks ago" \-- gitk`::
bd663611
LT
104
105 Show the changes during the last two weeks to the file 'gitk'.
106 The "--" is necessary to avoid confusion with the *branch* named
107 'gitk'
108
5d2fc913 109`git log --name-status release..test`::
e51c3b50
JH
110
111 Show the commits that are in the "test" branch but not yet
112 in the "release" branch, along with the list of paths
113 each commit modifies.
bd663611 114
5d2fc913 115`git log --follow builtin-rev-list.c`::
4f50f6a9
SW
116
117 Shows the commits that changed builtin-rev-list.c, including
118 those commits that occurred before the file was given its
119 present name.
120
5d2fc913 121`git log --branches --not --remotes=origin`::
d08bae7e
IL
122
123 Shows all commits that are in any of local branches but not in
0e615b25 124 any of remote-tracking branches for 'origin' (what you have that
d08bae7e
IL
125 origin doesn't).
126
5d2fc913 127`git log master --not --remotes=*/master`::
d08bae7e
IL
128
129 Shows all commits that are in local master but not in any remote
130 repository master branches.
131
5d2fc913 132`git log -p -m --first-parent`::
88d9d45d
PB
133
134 Shows the history including change diffs, but only from the
135 "main branch" perspective, skipping commits that come from merged
136 branches, and showing full diffs of changes introduced by the merges.
137 This makes sense only when following a strict policy of merging all
138 topic branches when staying on a single integration branch.
139
140
5dc7bcc2
JH
141Discussion
142----------
143
144include::i18n.txt[]
145
59893a88
JN
146Configuration
147-------------
148
149See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
150for settings related to diff generation.
151
152format.pretty::
153 Default for the `--format` option. (See "PRETTY FORMATS" above.)
154 Defaults to "medium".
155
156i18n.logOutputEncoding::
157 Encoding to use when displaying logs. (See "Discussion", above.)
158 Defaults to the value of `i18n.commitEncoding` if set, UTF-8
159 otherwise.
160
161log.date::
162 Default format for human-readable dates. (Compare the
163 `--date` option.) Defaults to "default", which means to write
164 dates like `Sat May 8 19:35:34 2010 -0500`.
165
166log.showroot::
167 If `false`, 'git log' and related commands will not treat the
168 initial commit as a big creation event. Any root commits in
169 `git log -p` output would be shown without a diff attached.
170 The default is `true`.
171
172mailmap.file::
173 See linkgit:git-shortlog[1].
174
175notes.displayRef::
176 Which refs, in addition to the default set by `core.notesRef`
177 or 'GIT_NOTES_REF', to read notes from when showing commit
178 messages with the 'log' family of commands. See
179 linkgit: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+
ab18b2c0 185This setting can be disabled by the `--no-notes` option,
59893a88 186overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
ab18b2c0 187and overridden by the `--notes=<ref>` option.
5dc7bcc2 188
3f971fc4
JH
189GIT
190---
9e1f0a85 191Part of the linkgit:git[1] suite