Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Search a whole Git repository

Writer Sebastian Wright

I'm looking for a tool that lets me perform a search through a complete Git repository (all branches). Ideally that tool would take some search pattern and would return a list of commit objects where that pattern appears (either in the file diffs or in the commit message [ I'm more interested in searching for the pattern in the commit messages than in the files]).

1 Answer

For searching commit messages, use git log --grep <regex> [branches].

For searching commit diffs, use git log -G <regex> [branches].

To specify all existing local branches, use --all in place of the branch name.

If you want only a list of hashes, use --format=%H.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy