Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
搜索git repo文件的所有版本_Git_Full Text Search_Atlassian Sourcetree - Fatal编程技术网

搜索git repo文件的所有版本

搜索git repo文件的所有版本,git,full-text-search,atlassian-sourcetree,Git,Full Text Search,Atlassian Sourcetree,我的计算机上有一个文件夹,它是git repo。 此文件夹包含一个名为fileA 我想在提交的所有版本fileA的内容中搜索字符串str 可能吗 我不是git方面的专家,我用它来管理回购 我对任何解决方案都感兴趣。例如,使用ou的解决方案适合我 使用SourceTree的解决方案 通过命令在终端中执行的解决方案已给出参见别名: 别名使用git rev list--all列出所有分支中的所有修订,并在每个修订上运行git grep 要使其适合于将一个文件变灰,请执行以下操作 git rev-li

我的计算机上有一个文件夹,它是git repo。 此文件夹包含一个名为
fileA

我想在提交的所有版本
fileA
的内容中搜索字符串
str

可能吗

我不是git方面的专家,我用它来管理回购

我对任何解决方案都感兴趣。例如,使用ou的解决方案适合我


使用SourceTree的解决方案 通过命令在终端中执行的解决方案已给出参见别名:

别名使用
git rev list--all
列出所有分支中的所有修订,并在每个修订上运行
git grep

要使其适合于将一个文件变灰,请执行以下操作

git rev-list --all | xargs -I% git --no-pager grep -F -e str % -- fileA
注:完全披露:我是链接存储库中的一名贡献者和审阅者。

对于使用SourceTree的“图形”解决方案,我猜您必须在其Jira跟踪网页上打开一个新问题,并请求新功能:


谢谢。我是否应该直接在文件夹/repo上执行此命令?谢谢,你能在回购协议的所有修订版中添加搜索
str
的命令吗?谢谢,在worktree目录中运行该命令。该命令在所有修订版上运行
git grep
;所有分支的所有修订都列在
git rev list--all
中。
git rev-list --all | xargs -I% git --no-pager grep -F -e str % -- fileA