Searching commit string in git log

suggest change

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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents