You can upgrade to the latest TFS, code search is available in TFS 2017, see Search your code for details.
However, in your case if you are using Git, you can use the code search tool Hound: a lightning fast code search tool.
The search is based on Russ Cox's Regular Expression Matching with a
Trigram Index algorithm, which is served up by a Go back-end
to a React front-end.
If your team has many and/or large code repositories and could benefit
from a unified, fast search tool, Hound is worth a look.
You can directly specify the Git repo
and Local Folder
as the data source to be searched.
To use the tool (Using Go Tools):
Install Go and create your workspace directory, %USERPROFILE%\go
as default.
Run cmd, C:\> cd %USERPROFILE%\go
Then run below command to install Hound:
go get github.com/etsy/hound/cmds/...
Create a config.json
file in a directory which houndd.exe
exist there (under %USERPROFILE%\go\bin
here) with your list of repositories added. eg:
{ "dbpath" : "data", "repos" : { "SomeGitRepo" : { "url" : "http://server:8080/tfs/CollectionLC/_git/Git-Scrum" }, "AnotherGitRepo" : { "url" : "http://server:8080/tfs/CollectionLC/_git/Git-GlobalSettings", "ms-between-poll": 10000, "exclude-dot-files": true }, "LocalFolder" : { "url" : "file:///C:/Users/andy/LocalRepo" } } }
Run the Hound server with houndd
and you should see output similar
to:
2017/09/19 17:21:50 Searcher started for AnotherGitRepo 2017/09/19 17:21:54 Searcher started for LocalFolder 2017/09/19 17:21:55 Searcher started for SomeGitRepo 2017/09/19 17:22:07 merge 0 files + mem 2017/09/19 17:22:07 14299049 data bytes, 1781057 index bytes 2017/09/19 17:22:07 All indexes built! 2017/09/19 17:22:07 running server at http://localhost:6080...
- Access http://localhost:6080 to search the code
