-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grep other branches without checkout #872
Comments
Hello, have you followed the examples in https://github.com/steveukx/git-js/blob/main/examples/git-grep.md ? The I haven't explicitly added options for querying on branches other than the one you have checked out. What would you expect that |
Thanks for your reply. I've used the examples, but the QueryBuilder only support the keyword. But if i want search keyword
Also if I add pathspec filter it will be like this
Also I've look the source code git-js/simple-git/src/lib/tasks/grep.ts Line 92 in fc10fbe
The options is front of searchTerm so it is no way to add branch or pathspec
it will run this like below
The git will combine the components and origin/master as a search term git-js/simple-git/src/lib/tasks/grep.ts Line 88 in fc10fbe
If this a enhanced feature or bug, could I contribute this? |
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:Is there any other way to do this, or is it necessary to implement this feature?
The text was updated successfully, but these errors were encountered: