【问题标题】:Is there a way to execute git-grep command on a remote repository tree?有没有办法在远程存储库树上执行 git-grep 命令?
【发布时间】:2019-07-19 12:24:25
【问题描述】:

我想搜索位于远程存储库 (origin/master) 的子树之一中的文件的内容。 git-grep 文档说该命令适用于当前工作树。因此,如何搜索构成远程 repo 树的文件?

【问题讨论】:

    标签: git grep repository git-grep


    【解决方案1】:

    在 git 中没有办法。您要么在本地获取远程提交,要么使用 out-of-git 访问远程存储库。使用 ssh,您只需执行 ssh remote-host "cd /repo && git grep"。通过网络访问使用提供的任何搜索。

    【讨论】:

      猜你喜欢
      • 2015-10-05
      • 1970-01-01
      • 1970-01-01
      • 2017-08-24
      • 1970-01-01
      • 2016-07-06
      • 2022-07-06
      • 2016-01-30
      • 1970-01-01
      相关资源
      最近更新 更多