Git Browsing the history Searching commit string in git log


Example

Searching git log using some string in log:

git log [options] --grep "search_string"

Example:

git log --all --grep "removed file"

Will search for removed file string in all logs in all branches.


Starting from git 2.4+, the search can be inverted using the --invert-grep option.

Example:

git log --grep="add file" --invert-grep

Will show all commits that do not contain add file.