Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.6k views
in Technique[技术] by (71.8m points)

c# - Microsoft Azure DevOps Repo: search for text/code in specific branch

I'm embarrassed to ask what should be a simple thing to figure out....

However, when I'm viewing a specific branch in an Azure DevOps repository online (e.g., when reviewing a PR), I can't figure out how to perform a search of that branch's code.

I see a global search textbox at the top, as follows: enter image description here

And I see a textbox for searching the branch for file/folder names, as follows:

enter image description here

But what I don't see is a textbox for searching the contents of the files in that branch....e.g. for finding occurrences of someFunction() or somePropertyName or whatever inside the code files for that particular branch.

Did Microsoft really omit this functionality? Or am I missing something? How do we perform such a search?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

First, input content in the global search textbox at the top and search:

enter image description here

Now, you can select your repo and branch the dropdown list: enter image description here

By default, code search only applies to your default branch. You may add up to 5 more here: enter image description here Please notice that when a new branch is configured for search via “include/exclude searchable branches”, the branch list of search is not immediately populated with the newly configured branch. This happens because it takes some time to on-board a new branch and make is searchable. It takes up to 12 hours to fully initialize the branch.

You can also refer to this document about search your code.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...