Friday, October 7, 2022

[SOLVED] Git grep gives unknown revision or path not in the working tree

Issue

I've cloned the entire directory. Now I want to search for the file with the phrase fatal: 'RuntimeException'

But, I keep getting that error.

~/core$ git grep throw RuntimeException;
fatal: ambiguous argument 'RuntimeException': unknown revision or path not in the working tree.

Here, core is the directory in which I have cloned the files.

PS: I'm new to this, so please excuse me if I've done something wrong.


Solution

Spaces are used to separate parameters, so git is thinking you want to search in revision or path named RuntimeException;. If you want to search for a string containing spaces, then enclose it in quotation marks.



Answered By - user918938
Answer Checked By - Cary Denson (WPSolving Admin)