apps > git
document updated a month ago, on Oct 9, 2023

how to search entire repositories

fetch the latest commits from ALL branches

Before you search, you may want to pull all the latest data.

    git fetch --all

If that isn't working for you, then try this suggestion.

To verify this worked: If you're using Gitlab on the server, it shows you the commit count. You can get your local repo commit count by doing this:

    git rev-list --count --all

list most recent commits, across ALL branches

    git log --all

search for file names

This searches all filenames that occur in any commit:

    git rev-list --all | xargs -I '{}' git ls-tree --full-tree -r '{}' | grep '.*HelloWorld\.pm$'

(this can easily take 30 seconds or more)

search through file contents