Skip to content

Commit 2ebbc76

Browse files
committed
add example for "git log -- path"
Signed-off-by: Junjie Yuan <[email protected]>
1 parent 1bd697e commit 2ebbc76

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

book/02-git-basics/sections/viewing-history.asc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,12 @@ $ git log -S function_name
262262

263263
The last really useful option to pass to `git log` as a filter is a path.
264264
If you specify a directory or file name, you can limit the log output to commits that introduced a change to those files.
265-
This is always the last option and is generally preceded by double dashes (`--`) to separate the paths from the options.
265+
This is always the last option and is generally preceded by double dashes (`--`) to separate the paths from the options:
266+
267+
[source,console]
268+
----
269+
$ git log -- path/to/file
270+
----
266271

267272
In <<limit_options>> we'll list these and a few other common options for your reference.
268273

0 commit comments

Comments
 (0)