With TFS I need to find a changeset by comment, and/or by developer. Maybe I'm just blind today, but I don't see a simple way in the Source Control Explorer to do this task?
-
1Now in VSTS / latest TFS you can now filter commits by author in commit history, but it seems you still can not filter / search on commits comments... I actually don't understand how this can not be proposed, I created a request on uservoice: https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/33810043-search-filter-commit-messages – Sÿl Apr 01 '18 at 06:45
11 Answers
If you have TFS Power Tools installed, you can run this in a command prompt:
tfpt searchcs
to get a GUI window with options to search by committer and comment text. I'm using TFS Power Tools (March 2011 version) and TFS 2010.

- 10,555
- 13
- 78
- 137

- 2,044
- 2
- 15
- 7
-
4This worked for me, with some thrashing on the settings. `Server name:` my server URL format was http://tfs01:8080/tfs, which I found in VS2010, Team menu, Connect to Team Foundation Server, Servers... button, and there was the existing server. `Under server path:` I noticed it's really looking for the local map path, so it was C:\tfs\myfolders\etc, not the url path from the server's point of view. – goodeye Oct 07 '11 at 00:46
-
1Stackoverflow converted my above comment regarding my URL format to a link. It's really `http://tfs01:8080/tfs` – goodeye Oct 07 '11 at 01:28
-
Worked for me with VS2010, even though TFS is 2008. TFPT2010 latest version, August 2011 – Paul Kapustin Oct 17 '11 at 13:20
-
1
-
2This worked for me from cmd.exe but not from the VS command window. – rstackhouse Feb 01 '13 at 16:54
-
Does not work for me in VS 2013, had to do it from command prompt. – Rush Frisby Dec 13 '13 at 14:10
-
-
You can specify the server and path on the command line, so the dialog opens ready to use: `tfpt searchcs /collection:http://tfs01:8080/tfs D:\tfs\myfolders\etc` – goodeye Dec 31 '14 at 18:53
-
Worked for me on VS 2015 with TFS 2013, only after I specified /collection and filesc in the command line as the above comment did. – Aaron Thomas Apr 22 '16 at 18:40
-
For VS 2015, I found the [Microsoft Visual Studio Team Foundation Server 2015 Power Tools](https://visualstudiogallery.msdn.microsoft.com/898a828a-af00-42c6-bbb2-530dc7b8f2e1) package, which I believe is simply the current release of the one linked in this answer. – JMD Jun 23 '16 at 18:35
-
If you `cd` to your local workspace directory, then run `tfpt searchcs`, it will auto-populate the `Server Name` and `Under Server Path` fields to match those of your workspace. – Walter Stabosz Mar 05 '19 at 19:10
EASY WAY and no 3rd party apps/add-ons needed:
- Open Source Control Explorer
- "View History" from the root of TFS server
- Scroll to the bottom (it's fast with hitting "End" button continuously)
- Select all records, copy
- Open Excel and paste
Now the Excel will allow you to search through comments (Excel's a native app, don't argue..).

- 2,636
- 1
- 21
- 17
-
15I don't think you will be searching the entire commit message for longer commit messages using this method (note the ellipses present when you paste), which would make this useful if you're sure that you're looking for something in the first-line synopsis, but dangerous otherwise. – Sep 30 '13 at 17:46
-
1
-
6I admit, at first I cringed when I first read this, but then I said to heck with third party tools, this idea works just fine. Thank you! – Chris Hawkes Mar 04 '16 at 19:49
-
Thank you for this. I tried downloading command-line tools and had no luck working with them. Always keep it simple, good job! – mdlars Jul 26 '16 at 16:37
-
5
-
7
-
1Is there any way to get the entirety of each comment? Trying to use this to get work history and the stupid ellipsis thing is in the way :( – Richard Griffiths Jul 02 '20 at 13:38
With the Power Tools installed:
tf history $/ -r | ? { $_.comment -like '*findme*' }

- 42,837
- 6
- 126
- 143

- 20,629
- 2
- 66
- 86
-
3Excuse my ignorance, but what's the "?" command into which you're piping the result of tfhistory? – Mal Ross Sep 02 '09 at 15:39
-
3It's the standard alias for Where-Object. See "help where -full" for complete details. – Richard Berg Sep 02 '09 at 21:16
-
5This doesn't work directly at a `cmd.exe` prompt, but it does in a PowerShell Console (with a few tweaks to the format of the -like parameter). – Emyr Oct 14 '14 at 10:43
There's a Visual Studio add-in that does it now: http://visualstudiogallery.msdn.microsoft.com/3f65dee8-5a44-4771-929b-26531c482fbf.
-
3
-
2If you go to the CodePlex site of the project, you will find a VS2012 version (which I haven't tested). https://findchangeset.codeplex.com/ – Maarten Jun 02 '14 at 11:43
-
2
-
Aha, yes. I've used it before but could not remember how I started it, lol. You just start the `Visual Studio Command Prompt` and execute the command @Maarten mentioned above. Of course, you would install Power Tools first! – strider Aug 25 '14 at 21:54
Alternatively, without having to install power tools, the following command will work if your looking for the search term findme.
Windows: tf history "$/Team Project/Development" /noprompt /recursive | findstr findme
Linux: tf history "$/Team Project/Development" /recursive | grep findme
NB. Please thank this guy if you found this useful.

- 2,330
- 3
- 24
- 37
-
2add "/format:detailed" if you want to search the entire message. If this takes too long, set date bounds (e.g. "/v:D1/1/2012~D12/31/2012") to reduce the search space. – Sep 30 '13 at 17:47
You can use the command line client: pipe the output of tf history to a file and then use whatever search program you prefer.

- 70,509
- 14
- 132
- 163
-
5example: tf history $/ /r /user:username /format:detailed > d:\changeset_details.txt – ray Mar 01 '11 at 21:13
Find Changeset By Comment 2013 for Visual Studio 2013 http://developer.azurewebsites.net/2014/08/find-changeset-by-comment-2013-for-visual-studio-2013/

- 529
- 5
- 8
I don't know a way to do it by Comment Text, but this will allow searching by developer:
If you open the menu item File->Source Control->Find In Source Control->Changesets... (you must be in Source Control Explorer for this to be available). This will open the Find Changesets dialog. You can then search for change sets by Developer on a given source folder (or project).
This will show you the comments, but you can't search by them. (Though you can sort the list by the comments and find the comment you are looking for that way.)
On a side note, if you want to see the details of the changeset via this dialog you have to click the Details button. Double clicking on a changeset closes the dialog.

- 78,325
- 149
- 468
- 850
-
1@Downvoter - Why the downvote? The OP said "and/or developer". This is a "Or Developer answer". – Vaccano Aug 06 '14 at 22:34
To see the checkins for a team member:
In team explorer, navigate to the Team Project, navigate to Team Members, right click the team member for who you want to see the changesets, and select "Show CheckIn History".

- 15,482
- 8
- 63
- 79
I added tfpt searchcs
from the TFS Power Tools as external tool in VisualStudio:
- Command:
C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\TFPT.EXE
(or wherever you installed your TFS Power Tools) - Arguments:
searchcs /collection:http://tfsserver:8080/tfs $(SolutionDir)
(the solution path is converted to the server path) - Initial Directory:
c:\path\to\your\vs\IDE
(unless thetf.exe
is in your path (what is not the case by default) this ensures you can view the changeset details from the search dialog, for it runstf.exe
)

- 260
- 1
- 13
I was able to do this in the TFS web portal code section.
Navigate to TFS in your browser, go to code, click on changesets, then advanced search. You can filter by user and date range. You can not search by comment, but if you have a general date range in mind then you can filter it down then use the browsers search (ctrl + f).

- 8,102
- 9
- 56
- 91
-
This is a lot easier than copying to Excel. Best answer so far, IMHO. You don't even need to input the date range; just click find, and you'll get all changesets; with comments. – Protector one Sep 12 '17 at 13:31
-
1
-