From 761f8f16e7e90024018af7aff31b707075c7f046 Mon Sep 17 00:00:00 2001 From: Asocia Date: Wed, 30 Jun 2021 13:18:59 +0300 Subject: [PATCH] Add a note about filtering logs --- git/notes-from-pro-git-book.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/git/notes-from-pro-git-book.md b/git/notes-from-pro-git-book.md index cf76a29..f5fd7f4 100644 --- a/git/notes-from-pro-git-book.md +++ b/git/notes-from-pro-git-book.md @@ -18,3 +18,11 @@ The --author option allows you to filter on a specific author ``` git log --author="Asocia" ``` + +- Getting the logs for a specific string + + +Another really helpful filter is the -S option (colloquially referred to as Git’s “pickaxe” option), which takes a string and shows only those commits that changed the number of occurrences of that string. For instance, if you wanted to find the last commit that added or removed a reference to a specific function, you could call: +``` +git log -S function_name +```