gitlesscase-insensitivegit-log

Case Insensitive Search on Git log comments


I use 'git log' and search for any comments by backslash / and typing the search text. Using this I cannot do case insensitive search. For example vi we can use ':set ic' and do the search. But in 'git log' it is always case sensitive. Which make it difficult to find the relevant text. People don't always have the same case when writing the commit message.

I can use the grep/sed on command line but it doesn't give the full picture and time consuming to type the regex.

Is there way for searching 'git log' case insensitively? Found out that git log is not using the vim/vi but similar pager

Update: I used the following command to update the git log search to be always case-insensitive

git config core.pager "less -IR -" 

Solution

  • git log typically sends its output to a pager program, you can use that to search.

    The pager is on probably less. If so, you can use -i or -I (they're subtly different) to make less searches ignore case.

    You can set the LESS environment variable to -i or -I, then less searches are case-insensitive by default everywhere. Or set core.pager to less -i or less -I so only it is only case-insensitive with Git.

    See the Git config value core.pager and the less manual for more.