criss cross rename failure workaround
[git/dscho.git] / Documentation / git-log.txt
blob83e4ee35cb0012c51e696d047d175f5b4561dd91
1 git-log(1)
2 ==========
4 NAME
5 ----
6 git-log - Show commit logs
9 SYNOPSIS
10 --------
11 'git log' [<options>] [<since>..<until>] [[\--] <path>...]
12 'git log' [<options>] -L n,m <path>
14 DESCRIPTION
15 -----------
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.
27 OPTIONS
28 -------
30 -<n>::
31         Limits the number of commits to show.
33 <since>..<until>::
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].
40 --follow::
41         Continue listing the history of a file beyond renames
42         (works only for a single file).
44 --no-decorate::
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
50         is 'short'.
52 --source::
53         Print out the ref name given on the command line by which each
54         commit was reached.
56 --full-diff::
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.
66 --log-size::
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.
73 -L <start>,<end>::
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.
80 --full-line-diff::
81         Always print the interesting range even if the current commit
82         does not change any line of the range.
84 [\--] <path>...::
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
88         refnames.
90 Common diff options
91 ~~~~~~~~~~~~~~~~~~~
93 :git-log: 1
94 include::diff-options.txt[]
96 include::rev-list-options.txt[]
98 include::pretty-formats.txt[]
100 include::diff-generate-patch.txt[]
102 Examples
103 --------
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
117         'gitk'
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
129         present name.
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
135         origin doesn't).
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.
151 Discussion
152 ----------
154 include::i18n.txt[]
156 Configuration
157 -------------
159 See linkgit:git-config[1] for core variables and linkgit:git-diff[1]
160 for settings related to diff generation.
162 format.pretty::
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
169         otherwise.
171 log.date::
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`.
176 log.showroot::
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`.
182 mailmap.file::
183         See linkgit:git-shortlog[1].
185 notes.displayRef::
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.
199 Author
200 ------
201 Written by Linus Torvalds <torvalds@osdl.org>
203 Documentation
204 --------------
205 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
209 Part of the linkgit:git[1] suite