gitatlassian-sourcetreegit-grep

How to git grep in Sourcetree


How do I run git-grep in SourceTree?

I can see the ability to search commit messages, commit SHAs, branches, file changes, and users, under Workspace > Search, but not content within the workspace itself.

Searching SourceTree Help from the Help menu had no matches for "grep", and Atlassian Answers for SourceTree doesn't seem to have any way to search for grep questions tagged with sourcetree: grep [sourcetree] only got one hit.


Solution

  • I just checked with the latest SourceTree 1.8.3 (and its release notes)

    This feature doesn't seem to be available for now.
    That means the command-line remains the best option for now.

    Of course, you could add a "custom action"... if only custom actions in SourceTree accepted input from the user.
    2016: Alas, SRCTREE-942 is still opened 3 years later.

    custom action

    As noted by the OP Andrew Grimm, SRCTREE-942 was closed in 2019.
    I just tested (Jan. 2023) with Sourcetree 3.4.10 and... it is still not supported: no prompt available.There is no error using $1, but searching '$1' itself is not useful.