Tuesday, July 9, 2013

How to Find a file in Source Code in TFS 2010

Today I'm going to illustrate how to find a particular file inside of the source code stored in Team Foundation Server.

Here is the scenario, My users request me to find all the files in the source code with the following string as part of the file name "Microsoft.VisualStudio.TestTools.UnitTesting”.

For a quick search you can use the Find in Source Control and I do not say that this will satisfy all needs but 98% it will give you the answer you are looking for .

First identify the scope of your search, in other words are you searching for the file in a single team project (TP) or in all the source code repository.

In this case I'm looking in the entire source control repository.

I opened the source control repository in the TP (C...) that I was working on, then I select folder DevBranches, 

note:I've change the name of the TP for privacy reasons.

- I opened the source control explorer and right click on the DevBranches folder.


- I selected find in source control and then select wildcard



After that you will see the following screen 

By default the path will be like $/C/DevBranches, In this case I'm extending  my search to the entire repository. so I edited the path to $/.

I put the wildcard with the text that I'm searching for and add a * at the end as the wild card.
and will give me the results form the repository,

here is the screen that reflects empty results.

Now to show how the screen looks with some results I change the text search to Microsoft.web.ui.*

In this illustration it is only showing folders, but the results include folders, file names.

remember the first node in folder is the Team Project they belong to.





Credits :
The tools used in this project GIMP portable, excellent image editor.GIMP download





No comments:

Post a Comment