【问题标题】:Git grep gives unknown revision or path not in the working tree.Git grep 给出了不在工作树中的未知修订版或路径。
【发布时间】:2012-03-17 22:13:00
【问题描述】:

我已经克隆了整个目录。现在我想搜索带有短语 fatal: 'RuntimeException' 的文件

但是,我不断收到这个错误。

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

这里,core 是我克隆文件的目录。

PS:我是新手,如果我做错了什么,请原谅。

【问题讨论】:

    标签: git grep


    【解决方案1】:

    空格用于分隔参数,因此 git 认为您要在名为 RuntimeException; 的修订版或路径中搜索。如果要搜索包含空格的字符串,请将其括在引号中。

    【讨论】:

      【解决方案2】:

      如果有多个单词,请使用引号将您的搜索模式括起来,例如

      $ git grep "throw RuntimeException;"
      

      【讨论】:

        猜你喜欢
        • 2021-09-15
        • 1970-01-01
        • 1970-01-01
        • 2016-09-15
        • 2012-08-29
        • 1970-01-01
        • 2017-12-19
        • 2020-07-24
        • 2022-11-30
        相关资源
        最近更新 更多