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