You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/02-git-basics/sections/viewing-history.asc
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Date: Sat Mar 15 10:31:28 2008 -0700
36
36
first commit
37
37
----
38
38
39
-
By default, with no arguments, `git log` lists the commits made in that repository in reverse chronological order – that is, the most recent commits show up first.
39
+
By default, with no arguments, `git log` lists the commits made in that repository in reverse chronological order -- that is, the most recent commits show up first.
40
40
As you can see, this command lists each commit with its SHA-1 checksum, the author's name and email, the date written, and the commit message.
41
41
42
42
A huge number and variety of options to the `git log` command are available to show you exactly what you're looking for.
@@ -145,7 +145,7 @@ a11bef06a3f659402fe7563abf99ad00de2209e6 first commit
145
145
----
146
146
147
147
The most interesting option is `format`, which allows you to specify your own log output format.
148
-
This is especially useful when you're generating output for machine parsing – because you specify the format explicitly, you know it won't change with updates to Git:(((log formatting)))
148
+
This is especially useful when you're generating output for machine parsing -- because you specify the format explicitly, you know it won't change with updates to Git:(((log formatting)))
149
149
150
150
[source,console]
151
151
----
@@ -181,7 +181,7 @@ a11bef0 - Scott Chacon, 6 years ago : first commit
181
181
182
182
You may be wondering what the difference is between _author_ and _committer_.
183
183
The author is the person who originally wrote the work, whereas the committer is the person who last applied the work.
184
-
So, if you send in a patch to a project and one of the core members applies the patch, both of you get credit – you as the author, and the core member as the committer.
184
+
So, if you send in a patch to a project and one of the core members applies the patch, both of you get credit -- you as the author, and the core member as the committer.
185
185
We'll cover this distinction a bit more in <<_distributed_git>>.
186
186
187
187
The `oneline` and `format` options are particularly useful with another `log` option called `--graph`.
This type of output will become more interesting as we go through branching and merging in the next chapter.
206
206
207
-
Those are only some simple output-formatting options to `git log` – there are many more.
207
+
Those are only some simple output-formatting options to `git log` -- there are many more.
208
208
<<log_options>> lists the options we've covered so far, as well as some other common formatting options that may be useful, along with how they change the output of the log command.
209
209
210
210
[[log_options]]
@@ -226,8 +226,8 @@ Those are only some simple output-formatting options to `git log` – there are
226
226
227
227
==== Limiting Log Output
228
228
229
-
In addition to output-formatting options, `git log` takes a number of useful limiting options – that is, options that let you show only a subset of commits.
230
-
You've seen one such option already – the `-2` option, which displays only the last two commits.
229
+
In addition to output-formatting options, `git log` takes a number of useful limiting options -- that is, options that let you show only a subset of commits.
230
+
You've seen one such option already -- the `-2` option, which displays only the last two commits.
231
231
In fact, you can do `-<n>`, where `n` is any integer to show the last `n` commits.
232
232
In reality, you're unlikely to use that often, because Git by default pipes all output through a pager so you see only one page of log output at a time.
233
233
@@ -239,7 +239,7 @@ For example, this command gets the list of commits made in the last two weeks:
239
239
$ git log --since=2.weeks
240
240
----
241
241
242
-
This command works with lots of formats – you can specify a specific date like `"2008-01-15"`, or a relative date such as `"2 years 1 day 3 minutes ago"`.
242
+
This command works with lots of formats -- you can specify a specific date like `"2008-01-15"`, or a relative date such as `"2 years 1 day 3 minutes ago"`.
243
243
244
244
You can also filter the list to commits that match some search criteria.
245
245
The `--author` option allows you to filter on a specific author, and the `--grep` option lets you search for keywords in the commit messages.
0 commit comments