Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
106 views

Summary / Question Does git diff pass arguments provided to it down through to sub commands (e.g. git grep) when invoked? For example, when calling git diff -G with an additional flag of -i as well (e....
David's user avatar
  • 131
3 votes
1 answer
125 views

I'd like to (1) search a git repo codebase files (not commit messages!) for a certain string, and then (2) list all occurrences (filename only, but for each result), but (3) also have those ...
Rabarberski's user avatar
1 vote
1 answer
171 views

I would like to use git grep to check for banned strings in the repo. if git grep --full-name --extended-regexp --line-number 'bad|words' then echo has bad words else echo does not have bad ...
user avatar
0 votes
2 answers
92 views

I'm trying to create a macro on my shell. The operation I'm trying to automate is this one: Find all the files containing TEXT_TO_SEARCH, and open them with VSCODE I can do this with a one-liner $ ...
ychiucco's user avatar
  • 875
4 votes
1 answer
594 views

I'd like to git grep in the usual way, but with something like the additional insight of git blame in the displayed results. In some instances I probably would benefit from including the metadata in ...
sh1's user avatar
  • 5,010
0 votes
2 answers
2k views

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 ...
Gabriel Staples's user avatar
0 votes
0 answers
53 views

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 ...
r0tt's user avatar
  • 389
2 votes
2 answers
1k views

I tried this git log -i --all --grep='/(?=.*fix)(?=.*a)(?=.*bug)/' but did not work.
joydeba's user avatar
  • 1,353
-2 votes
1 answer
287 views

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's user avatar
1 vote
1 answer
105 views

does any of you know if there a way to apply git color with both bold and underline (or as a more general question - apply color with multiple style args)? I try to set git config color.grep.filename ...
Hacktivator's user avatar
0 votes
2 answers
838 views

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. ...
Dmitro25's user avatar
  • 173
1 vote
1 answer
98 views

I am looking for the list of files where some tests are commented like // beforeEach(async(() => { // beforeEach(async(() => { // beforeEach(async(() => { // beforeEach(async(()...
sensorario's user avatar
  • 21.9k
1 vote
2 answers
2k views

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 ...
Jim's user avatar
  • 4,529
4 votes
1 answer
1k views

I would like to search the contents of files located in one of subtrees of the remote repository (origin/master). git-grep documentation says that command works on a current working tree. Consequently,...
Marek Bocian's user avatar
2 votes
1 answer
1k views

When I'm trying to find a pattern in a git-based project, I type: git grep <pattern> and git searches the entire project for that pattern. Sometimes this finds matches in non-source files, ...
Kevin Bedell's user avatar
  • 13.5k
3 votes
2 answers
851 views

I am trying to use git grep to search all revisions of a very large repository. The command I am using is: $ git rev-list --all | xargs git grep -I --threads 10 --line-number \ --only-matching "...
Chris's user avatar
  • 6,284
2 votes
1 answer
369 views

I would like to write a git alias for: git log --all --grep='Big boi' What I have so far is: [alias] search = "!f() { str=${@}; echo $str; git log --all --grep=$str; }; f" Which echos the string ...
joshuatvernon's user avatar
25 votes
2 answers
26k views

I want to look only at distinct files which have a certain word in their text. current_directory$ git grep 'word' shows each line of the file which has a matching word. So I tried this ...
Anushi Maheshwari's user avatar
-2 votes
1 answer
101 views

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's user avatar
  • 1,721
0 votes
2 answers
225 views

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 ...
Sam Carleton's user avatar
  • 1,420
6 votes
1 answer
1k views

I would like to order results returned by git grep using some git-related criteria, for example the commit date. Is there a way to do that?
Peter Bašista's user avatar
0 votes
1 answer
53 views

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 ...
user avatar
0 votes
0 answers
482 views

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 ...
user avatar
3 votes
0 answers
93 views

Is there a way to use type signature searches on not just the current working set, but the entire history of a project? The purpose would be to find and possibly recycle Haskell functions that were ...
E Bro's user avatar
  • 33
2 votes
2 answers
1k views

I'm attempting to find files in my git repository using git grep and I have no easy way of doing so without manual searching. I have found one workaround like this: git grep -l 'term1' | xargs -i ...
JacobIRR's user avatar
  • 9,046
7 votes
2 answers
12k views

I'm trying to grep all line breaks after some binary operators in a project using git bash on a Windows machine. Tried the following commands which did not work: $ git grep "[+-*\|%]\ *\n" fatal: ...
AXO's user avatar
  • 9,226
1 vote
1 answer
487 views

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 ...
eugene's user avatar
  • 42.1k
2 votes
1 answer
878 views

Sometimes I do a git grep, and there's that one line which is so long it takes up half a page or more because of line wrapping. How can I tell git grep to turn of line wrapping, instead requiring me ...
Andrew Grimm's user avatar
  • 82.3k
4 votes
2 answers
2k views

I'm trying to custom color my Git. After reading through the documentation, I've found my options I wanted to set. Everything was working fine except the Grep. I've realised, I haven't really used ...
ppseprus's user avatar
  • 557
2 votes
2 answers
1k views

I tried using git grep -i 'search' README.md and the output found some lines I was interested in looking at, but these lines did not print out the git sha's so that I could get more information about ...
Daniel Kaplan's user avatar
16 votes
5 answers
7k views

I want to git grep the files which has two pre-specified words (if both exist, i.e. ANDing), assume these two words are word1 and word2 I tried git grep -e 'word1' --and -e 'word2' And also I tried ...
Ashraf Bashir's user avatar
2 votes
0 answers
675 views

I am trying to create bash script that checks my source code to flag absolutely url's as all of our devs should be using relative url's when it comes to internal links. I was thinking to create a ...
shredtechular's user avatar
1 vote
1 answer
1k views

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 ...
Andrew Grimm's user avatar
  • 82.3k
13 votes
3 answers
5k views

I know how to run gblame inside a file. I know how to grep a content inside all files in a directory. I'd like to see gblame of particular lines around that one that contains a content. Example: $ ...
sensorario's user avatar
  • 21.9k