Byron PeeblesBlog

Git and finding the history of removed content

Sometimes you may wonder how, if ever, some constant, variable, or function that is appearly largely unused was ever used in the past. Running git blame can sometimes provide clues but using git log -S<str> or git log -G<regex> is invaluable at finding when particualr bits of text were deleted. Really, it shows you the history of when that string appears in a commit, either added or deleted.