Skip to content

Instantly share code, notes, and snippets.

@embano1
Created July 10, 2018 10:54
Show Gist options
  • Save embano1/02b48aedf6c90bbe91545b25c14c3f8e to your computer and use it in GitHub Desktop.
Save embano1/02b48aedf6c90bbe91545b25c14c3f8e to your computer and use it in GitHub Desktop.
Search string/regex in git history, e.g. deleted/replaced code

Example for Kubernetes DebugContainers

$ git clone https://github.com/kubernetes/kubernetes
# Increase search limit and only print commit IDs
$ git -c diff.renameLimit=99999 log -SDebugContainers --pretty=format:"%h"
# Increase search limit and print commit with patch information
$ git -c diff.renameLimit=99999 log -SDebugContainers -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment