Skip to content

grep other branches without checkout #872

Open
@Bill2015

Description

@Bill2015

I am trying to use the git grep command to search for text in other branches without checking out to those branches.
Although the git grep command allows me to do this by specifying the branch name (e.g. git grep <Regex> <branchName>), the current grep() function does not seem to support this.

The only way to search for text in other branches is to disable ts-check and then use the following code:

// @ts-nocheck
const result = await simpleGit().grep(['hello', 'origin/master'], ['-C', '1']);

Is there any other way to do this, or is it necessary to implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions