6 git-log - Show commit logs
11 'git log' [<options>] [<since>..<until>] [[\--] <path>...]
12 'git log' [<options>] -L n,m <path>
16 Shows the commit logs.
18 The command takes options applicable to the 'git rev-list'
19 command to control what is shown and how, and options applicable to
20 the 'git diff-*' commands to control how the changes
21 each commit introduces are shown.
23 With '-L' option, the command will help to trace the history of user specified
24 line ranges. It can trace multiple ranges coming from multiple files.
31 Limits the number of commits to show.
34 Show only commits between the named two commits. When
35 either <since> or <until> is omitted, it defaults to
36 `HEAD`, i.e. the tip of the current branch.
37 For a more complete list of ways to spell <since>
38 and <until>, see linkgit:gitrevisions[1].
41 Continue listing the history of a file beyond renames
42 (works only for a single file).
45 --decorate[=short|full|no]::
46 Print out the ref names of any commits that are shown. If 'short' is
47 specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
48 'refs/remotes/' will not be printed. If 'full' is specified, the
49 full ref name (including prefix) will be printed. The default option
53 Print out the ref name given on the command line by which each
57 Without this flag, "git log -p <path>..." shows commits that
58 touch the specified paths, and diffs about the same specified
59 paths. With this, the full diff is shown for commits that touch
60 the specified paths; this means that "<path>..." limits only
61 commits, and doesn't limit diff for those commits.
63 Note that this affects all diff-based output types, e.g. those
64 produced by --stat etc.
67 Before the log message print out its size in bytes. Intended
68 mainly for porcelain tools consumption. If git is unable to
69 produce a valid value size is set to zero.
70 Note that only message is considered, if also a diff is shown
71 its size is not included.
74 The line range. <start> and <end> can take one of these forms:
76 include::line-range-format.txt[]
77 You can also specify this option more than once before each path.
81 Always print the interesting range even if the current commit
82 does not change any line of the range.
85 Show only commits that affect any of the specified paths. To
86 prevent confusion with options and branch names, paths may need
87 to be prefixed with "\-- " to separate them from options or
94 include::diff-options.txt[]
96 include::rev-list-options.txt[]
98 include::pretty-formats.txt[]
100 include::diff-generate-patch.txt[]
104 git log --no-merges::
106 Show the whole commit history, but skip any merges
108 git log v2.6.12.. include/scsi drivers/scsi::
110 Show all commits since version 'v2.6.12' that changed any file
111 in the include/scsi or drivers/scsi subdirectories
113 git log --since="2 weeks ago" \-- gitk::
115 Show the changes during the last two weeks to the file 'gitk'.
116 The "--" is necessary to avoid confusion with the *branch* named
119 git log --name-status release..test::
121 Show the commits that are in the "test" branch but not yet
122 in the "release" branch, along with the list of paths
123 each commit modifies.
125 git log --follow builtin-rev-list.c::
127 Shows the commits that changed builtin-rev-list.c, including
128 those commits that occurred before the file was given its
131 git log --branches --not --remotes=origin::
133 Shows all commits that are in any of local branches but not in
134 any of remote tracking branches for 'origin' (what you have that
137 git log master --not --remotes=*/master::
139 Shows all commits that are in local master but not in any remote
140 repository master branches.
142 git log -p -m --first-parent::
144 Shows the history including change diffs, but only from the
145 "main branch" perspective, skipping commits that come from merged
146 branches, and showing full diffs of changes introduced by the merges.
147 This makes sense only when following a strict policy of merging all
148 topic branches when staying on a single integration branch.
159 See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
160 for settings related to diff generation.
163 Default for the `--format` option. (See "PRETTY FORMATS" above.)
164 Defaults to "medium".
166 i18n.logOutputEncoding::
167 Encoding to use when displaying logs. (See "Discussion", above.)
168 Defaults to the value of `i18n.commitEncoding` if set, UTF-8
172 Default format for human-readable dates. (Compare the
173 `--date` option.) Defaults to "default", which means to write
174 dates like `Sat May 8 19:35:34 2010 -0500`.
177 If `false`, 'git log' and related commands will not treat the
178 initial commit as a big creation event. Any root commits in
179 `git log -p` output would be shown without a diff attached.
180 The default is `true`.
183 See linkgit:git-shortlog[1].
186 Which refs, in addition to the default set by `core.notesRef`
187 or 'GIT_NOTES_REF', to read notes from when showing commit
188 messages with the 'log' family of commands. See
189 linkgit:git-notes[1].
191 May be an unabbreviated ref name or a glob and may be specified
192 multiple times. A warning will be issued for refs that do not exist,
193 but a glob that does not match any refs is silently ignored.
195 This setting can be disabled by the `--no-standard-notes` option,
196 overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
197 and supplemented by the `--show-notes` option.
201 Written by Linus Torvalds <torvalds@osdl.org>
205 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
209 Part of the linkgit:git[1] suite