简体   繁体   English

如何在 gitlab 中搜索 URL?

[英]How to search for a URL in gitlab?

May be this is too straightforward but I am unable to do a basic search for a url in gitlab UI.可能这太简单了,但我无法在 gitlab UI 中对 url 进行基本搜索。

URL = /api/v1/user/{userId}

I need to check in which file or project of a particular repository this path exists but gitlab search returns我需要检查此路径存在于特定存储库的哪个文件或项目中,但 gitlab 搜索返回

We couldn't find any projects matching /api/v1/user/{userId}

I am assuming it has something to do with / just like escape sequence.我假设它与/就像转义序列有关。

Can someone help?有人可以帮忙吗?

Thanks谢谢

There are two issues here.这里有两个问题。

Firstly, by default, queries in the search bar will search for projects by name.首先,默认情况下,搜索栏中的查询将按名称搜索项目 Since you are looking for occurrences in code, make sure you are using the code tab of the search.由于您正在寻找代码中的出现,请确保您使用的是搜索的代码选项卡。 If you don't see the code tab in the global search, it means your self-hosted GitLab instance does not have advanced search configured and, in which case, you can only search for code project-by-project and you cannot use advanced search syntax.如果您在全局搜索中没有看到代码选项卡,则表示您的自托管 GitLab 实例没有配置高级搜索,此时您只能逐个项目搜索代码,不能使用高级搜索语法。

Secondly, you need to use an advanced search syntax to search for an exact match to a string.其次,您需要使用高级搜索语法来搜索与字符串完全匹配的内容。 In this case, you should enclose the literal string you want to match in quotes, like: "/api/v1/user/{userId}" .在这种情况下,您应该将要匹配的文字字符串括在引号中,例如: "/api/v1/user/{userId}" For further reading, see advanced search syntax .如需进一步阅读,请参阅高级搜索语法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM