Questions tagged [git-grep]
28 questions
1
vote
1 answer
fatal: command line, '\/\/( ){0,}beforeEach\(async\(\(\) => \{$': Unmatched \{
I am looking for the list of files where some tests are commented like
// beforeEach(async(() => {
// beforeEach(async(() => {
// beforeEach(async(() => {
// beforeEach(async(() => {
From https://regex101.com/
\/\/(…

sensorario
- 20,262
- 30
- 97
- 159
1
vote
2 answers
git grepping on filenames
How can I pipe to git grep a list of files on which I want to search a specific pattern?
Specifically I do this:
git grep -l 'string to search'
and I want to do another git grep on the result files of the previous search.
Trying
git grep -l…

Jim
- 3,845
- 3
- 22
- 47
1
vote
0 answers
How can I get rid of iine (end) in git grep and how do I use with exclude-standard?
I execute this command:
git grep -Ee "alex" -- bin
and I don't return to shell. In the end there is "line (end)".
How can I get rid of iine (end) without
git grep -Ee "alex" -- bin | more or kill the process ?
because I want to save color of…
user8588509
1
vote
1 answer
helm-grep-do-git-grep searches in the current directory
helm-grep-do-git-grep with a prefix arg grep whole repo and without
grep only current dir.
I want it reversed
helm-grep-do-git-grep without a prefix arg grep whole repo and with
grep only current dir.
How can i define a function to reverse…

eugene
- 39,839
- 68
- 255
- 489
1
vote
1 answer
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…

Andrew Grimm
- 78,473
- 57
- 200
- 338
0
votes
2 answers
How to `git grep` through a range of commits, all commits from the current commit back to the parent commit, or through all commits in entire repo
I'd like to be able to use git grep to do a regular expression search through:
the current commit
a given commit
a list of commits
a range of commits
a given commit all the way back to the parent commit
all commits (and branches) in the entire…

Gabriel Staples
- 36,492
- 15
- 194
- 265
0
votes
0 answers
Can I combine git-archive with git-grep?
For a DevOps solution I'm looking for a way to combine git archive with git grep. Is it possible to combine this? e.g.:
git archive --remote=url.project.git HEAD: git grep -i searchString $(git branch -r) | tar -x

r0tt
- 379
- 3
- 20
0
votes
2 answers
How to use "git grep" to search for 8-bit encoded text in a files with the same encoding
I have a project where the files are 8-bit encoded (Win-1251).
Can you please tell me if there is a way using git grep to find a phrase composed of characters from the top of the ASCII table (i.e. with codes from 0x80 to 0xFF)?
I work under Windows.…

Dmitro25
- 143
- 7
0
votes
1 answer
"git grep " for just python (or any type of) files?
When I'm trying to find a pattern in a git-based project, I type:
git grep
and git searches the entire project for that pattern. Sometimes this finds matches in non-source files, which makes finding what I'm looking for harder.
How can I…

Kevin Bedell
- 13,254
- 10
- 78
- 114
0
votes
2 answers
Searching Git for multiple hash's at one time
I just got a directive to revert a bunch of committed code. The good news is that all commit's have a reference string in them, something like:
ABC-1556
ABC-1616
ABC-4818
ABC-5919
This commend will give me one of them, how do I modify the grep…

Sam Carleton
- 1,339
- 7
- 23
- 45
0
votes
1 answer
I want to skip pattern in comments between /* */ or whatever
I want to skip pattern in comments between /* */ or whatever.
for example f:
My name is
/*
alex
nice man
*/
alex is a nice man
Command:
git grep "alex" f
Print only:
alex is a nice man
I prefer use with git grep.
user8588509
-2
votes
1 answer
git grep: Where is "binary file" in match?
I'm looking for something that may have been committed in a Git repository. I'm using a command like the following:
git grep ABCD `git rev-list --all`
and getting output like
Binary file…

Humble Hacker
- 17
- 1
- 3
-2
votes
1 answer
Find out when the last use of variable was removed from the git repo
I have an unused variable in my code, and I wonder how things got to be this way. Can I use git grep (or something else) to find out easily?

Mark VY
- 1,489
- 16
- 31