Find all Git commits where a string was added, removed or modified in the file contents

Created on Mar 02, 2020 by 

  1. copygit log -S <string>


description

If you want to find all commits where "word" was added or removed in the file contents (to be more exact: where number of occurences of "word" changed), i.e. search the commit contents, use so called 'pickaxe' search with:

$ git log -S word

Source: https://stackoverflow.com/a/1340245/5195008

git


name

git - the stupid content tracker

synopsis

git [--version] [--help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]

description

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.