TFS: Search for a file by name in source control

Solution 1:

If you are using Visual Studio 2010

  • Right click on your collection or team project
  • Select 'Find in source control'
  • Then select 'status' or 'wildcard'
  • You can search for your files there

The following will list all the items in your repository without checking them out

tf Dir command

tf dir /recursive $/

you can pass in the item you are searching for also e.g.

tf dir /recursive $/*.cs

gets all the .cs files in all team projects

Note: depending on how big your source is, this could take sometime.

Solution 2:

If you have created a workspace on your local, then you can search a file in your local to get the path.

Solution 3:

If you're using Azure DevOps you can open the Azure Repos section in Azure DevOps for your project. There is a search input on this screen that allows you to search your code. You can find out more in Microsoft's documentation: https://docs.microsoft.com/en-us/azure/devops/project/search/code-search?view=azure-devops