Skip to content

Instantly share code, notes, and snippets.

@Lukas238
Last active August 15, 2018 20:51
Show Gist options
  • Select an option

  • Save Lukas238/0b0e5072adb6cb715107811c519fd781 to your computer and use it in GitHub Desktop.

Select an option

Save Lukas238/0b0e5072adb6cb715107811c519fd781 to your computer and use it in GitHub Desktop.
Search a string in files in repo history

Search a string in files in repo history

In case you need to check if some string existed on a old version of a file in your repository history, Git provide this command:

$ git log -S'text to search' --oneline --name-status

In case you have this error message: ''' warning: inexact rename detection was skipped due to too many files. warning: you may want to set your diff.renameLimit variable to at least 1229 and retry the command. '''

You can fix it by setting an upper limit like this:

$ git config diff.renameLimit 99999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment