6 git-log - Show commit logs
12 'git log' [<options>] [<since>..<until>] [[\--] <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.
28 Show only commits between the named two commits. When
29 either <since> or <until> is omitted, it defaults to
30 `HEAD`, i.e. the tip of the current branch.
31 For a more complete list of ways to spell <since>
32 and <until>, see linkgit:gitrevisions[7].
35 Continue listing the history of a file beyond renames
36 (works only for a single file).
39 --decorate[=short|full|no]::
40 Print out the ref names of any commits that are shown. If 'short' is
41 specified, the ref name prefixes 'refs/heads/', 'refs/tags/' and
42 'refs/remotes/' will not be printed. If 'full' is specified, the
43 full ref name (including prefix) will be printed. The default option
47 Print out the ref name given on the command line by which each
51 Use mailmap file to map author and committer names and email
52 to canonical real names and email addresses. See
53 linkgit:git-shortlog[1].
56 Without this flag, "git log -p <path>..." shows commits that
57 touch the specified paths, and diffs about the same specified
58 paths. With this, the full diff is shown for commits that touch
59 the specified paths; this means that "<path>..." limits only
60 commits, and doesn't limit diff for those commits.
62 Note that this affects all diff-based output types, e.g. those
63 produced by --stat etc.
66 Before the log message print out its size in bytes. Intended
67 mainly for porcelain tools consumption. If Git is unable to
68 produce a valid value size is set to zero.
69 Note that only message is considered, if also a diff is shown
70 its size is not included.
73 Show only commits that are enough to explain how the files
74 that match the specified paths came to be. See "History
75 Simplification" below for details and other simplification
78 To prevent confusion with options and branch names, paths may need to
79 be prefixed with "\-- " to separate them from options or refnames.
81 include::rev-list-options.txt[]
83 include::pretty-formats.txt[]
89 include::diff-options.txt[]
91 include::diff-generate-patch.txt[]
95 `git log --no-merges`::
97 Show the whole commit history, but skip any merges
99 `git log v2.6.12.. include/scsi drivers/scsi`::
101 Show all commits since version 'v2.6.12' that changed any file
102 in the include/scsi or drivers/scsi subdirectories
104 `git log --since="2 weeks ago" -- gitk`::
106 Show the changes during the last two weeks to the file 'gitk'.
107 The "--" is necessary to avoid confusion with the *branch* named
110 `git log --name-status release..test`::
112 Show the commits that are in the "test" branch but not yet
113 in the "release" branch, along with the list of paths
114 each commit modifies.
116 `git log --follow builtin-rev-list.c`::
118 Shows the commits that changed builtin-rev-list.c, including
119 those commits that occurred before the file was given its
122 `git log --branches --not --remotes=origin`::
124 Shows all commits that are in any of local branches but not in
125 any of remote-tracking branches for 'origin' (what you have that
128 `git log master --not --remotes=*/master`::
130 Shows all commits that are in local master but not in any remote
131 repository master branches.
133 `git log -p -m --first-parent`::
135 Shows the history including change diffs, but only from the
136 "main branch" perspective, skipping commits that come from merged
137 branches, and showing full diffs of changes introduced by the merges.
138 This makes sense only when following a strict policy of merging all
139 topic branches when staying on a single integration branch.
142 Limits the number of commits to show to 3.
152 See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
153 for settings related to diff generation.
156 Default for the `--format` option. (See "PRETTY FORMATS" above.)
157 Defaults to "medium".
159 i18n.logOutputEncoding::
160 Encoding to use when displaying logs. (See "Discussion", above.)
161 Defaults to the value of `i18n.commitEncoding` if set, UTF-8
165 Default format for human-readable dates. (Compare the
166 `--date` option.) Defaults to "default", which means to write
167 dates like `Sat May 8 19:35:34 2010 -0500`.
170 If `false`, 'git log' and related commands will not treat the
171 initial commit as a big creation event. Any root commits in
172 `git log -p` output would be shown without a diff attached.
173 The default is `true`.
176 See linkgit:git-shortlog[1].
179 Which refs, in addition to the default set by `core.notesRef`
180 or 'GIT_NOTES_REF', to read notes from when showing commit
181 messages with the 'log' family of commands. See
182 linkgit:git-notes[1].
184 May be an unabbreviated ref name or a glob and may be specified
185 multiple times. A warning will be issued for refs that do not exist,
186 but a glob that does not match any refs is silently ignored.
188 This setting can be disabled by the `--no-notes` option,
189 overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
190 and overridden by the `--notes=<ref>` option.
194 Part of the linkgit:git[1] suite