Documentation / git-log.txton commit Symlink mergetools scriptlets into valgrind wrappers (ee0d7bf)
   1git-log(1)
   2==========
   3
   4NAME
   5----
   6git-log - Show commit logs
   7
   8
   9SYNOPSIS
  10--------
  11[verse]
  12'git log' [<options>] [<since>..<until>] [[\--] <path>...]
  13
  14DESCRIPTION
  15-----------
  16Shows the commit logs.
  17
  18The command takes options applicable to the 'git rev-list'
  19command to control what is shown and how, and options applicable to
  20the 'git diff-*' commands to control how the changes
  21each commit introduces are shown.
  22
  23
  24OPTIONS
  25-------
  26
  27-<n>::
  28        Limits the number of commits to show.
  29        Note that this is a commit limiting option, see below.
  30
  31<since>..<until>::
  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.
  35        For a more complete list of ways to spell <since>
  36        and <until>, see linkgit:gitrevisions[7].
  37
  38--follow::
  39        Continue listing the history of a file beyond renames
  40        (works only for a single file).
  41
  42--no-decorate::
  43--decorate[=short|full|no]::
  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'.
  49
  50--source::
  51        Print out the ref name given on the command line by which each
  52        commit was reached.
  53
  54--full-diff::
  55        Without this flag, "git log -p <path>..." shows commits that
  56        touch the specified paths, and diffs about the same specified
  57        paths.  With this, the full diff is shown for commits that touch
  58        the specified paths; this means that "<path>..." limits only
  59        commits, and doesn't limit diff for those commits.
  60+
  61Note that this affects all diff-based output types, e.g. those
  62produced by --stat etc.
  63
  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
  71[\--] <path>...::
  72        Show only commits that affect any of the specified paths. To
  73        prevent confusion with options and branch names, paths may need
  74        to be prefixed with "\-- " to separate them from options or
  75        refnames.
  76
  77include::rev-list-options.txt[]
  78
  79include::pretty-formats.txt[]
  80
  81Common diff options
  82-------------------
  83
  84:git-log: 1
  85include::diff-options.txt[]
  86
  87include::diff-generate-patch.txt[]
  88
  89Examples
  90--------
  91`git log --no-merges`::
  92
  93        Show the whole commit history, but skip any merges
  94
  95`git log v2.6.12.. include/scsi drivers/scsi`::
  96
  97        Show all commits since version 'v2.6.12' that changed any file
  98        in the include/scsi or drivers/scsi subdirectories
  99
 100`git log --since="2 weeks ago" \-- gitk`::
 101
 102        Show the changes during the last two weeks to the file 'gitk'.
 103        The "--" is necessary to avoid confusion with the *branch* named
 104        'gitk'
 105
 106`git log --name-status release..test`::
 107
 108        Show the commits that are in the "test" branch but not yet
 109        in the "release" branch, along with the list of paths
 110        each commit modifies.
 111
 112`git log --follow builtin-rev-list.c`::
 113
 114        Shows the commits that changed builtin-rev-list.c, including
 115        those commits that occurred before the file was given its
 116        present name.
 117
 118`git log --branches --not --remotes=origin`::
 119
 120        Shows all commits that are in any of local branches but not in
 121        any of remote-tracking branches for 'origin' (what you have that
 122        origin doesn't).
 123
 124`git log master --not --remotes=*/master`::
 125
 126        Shows all commits that are in local master but not in any remote
 127        repository master branches.
 128
 129`git log -p -m --first-parent`::
 130
 131        Shows the history including change diffs, but only from the
 132        "main branch" perspective, skipping commits that come from merged
 133        branches, and showing full diffs of changes introduced by the merges.
 134        This makes sense only when following a strict policy of merging all
 135        topic branches when staying on a single integration branch.
 136
 137
 138Discussion
 139----------
 140
 141include::i18n.txt[]
 142
 143Configuration
 144-------------
 145
 146See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
 147for settings related to diff generation.
 148
 149format.pretty::
 150        Default for the `--format` option.  (See "PRETTY FORMATS" above.)
 151        Defaults to "medium".
 152
 153i18n.logOutputEncoding::
 154        Encoding to use when displaying logs.  (See "Discussion", above.)
 155        Defaults to the value of `i18n.commitEncoding` if set, UTF-8
 156        otherwise.
 157
 158log.date::
 159        Default format for human-readable dates.  (Compare the
 160        `--date` option.)  Defaults to "default", which means to write
 161        dates like `Sat May 8 19:35:34 2010 -0500`.
 162
 163log.showroot::
 164        If `false`, 'git log' and related commands will not treat the
 165        initial commit as a big creation event.  Any root commits in
 166        `git log -p` output would be shown without a diff attached.
 167        The default is `true`.
 168
 169mailmap.file::
 170        See linkgit:git-shortlog[1].
 171
 172notes.displayRef::
 173        Which refs, in addition to the default set by `core.notesRef`
 174        or 'GIT_NOTES_REF', to read notes from when showing commit
 175        messages with the 'log' family of commands.  See
 176        linkgit:git-notes[1].
 177+
 178May be an unabbreviated ref name or a glob and may be specified
 179multiple times.  A warning will be issued for refs that do not exist,
 180but a glob that does not match any refs is silently ignored.
 181+
 182This setting can be disabled by the `--no-notes` option,
 183overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable,
 184and overridden by the `--notes=<ref>` option.
 185
 186GIT
 187---
 188Part of the linkgit:git[1] suite