How to search for changes to some text in the commit history
Sometimes you need to know when name of a variable or any of its default value was changed in your commit history. The following command will come in really handy. For example to search for the text - 'welcome', you would use This will search the content of the files where the word 'welcome' was present and if any changes were made to that line aka - even the word itself was not changed but its number of occurences on that line changed, you would get a result. If you are only interested in knowing when the word itself changed, use the -S option For example Note that -G accepts a regex whereas -S accepts a string.git log -G<regex>
git log -Gwelcome
git log -S<string>
git log -Swelcome